Jump to content

Ian_A

Circle Member
  • Posts

    8
  • Joined

  • Last visited

Everything posted by Ian_A

  1. Here is the jQuery solution I use to accomplish this: <script src="https://code.jquery.com/jquery-3.6.4.min.js"></script> <script> // Function to replace image-slide-title content with alt tag for images within sqs-gallery-container using jQuery $(document).ready(function() { $('.sqs-gallery-container img').each(function(index) { $('.image-slide-title').eq(index).html($(this).attr('alt').replace('.jpg', '')); }); }); </script>
  2. Old topic, but incase anyone is still in need of a solution, here is how I do it with jQuery. I apply the code per page as I only use it on specific gallery pages made for client previews. <script src="https://code.jquery.com/jquery-3.6.4.min.js"></script> <script> // Function to replace image-slide-title content with alt tag for images within sqs-gallery-container using jQuery $(document).ready(function() { $('.sqs-gallery-container img').each(function(index) { $('.image-slide-title').eq(index).html($(this).attr('alt').replace('.jpg', '')); }); }); </script>
  3. This will only work on 1 form per page. If your forms are all on different pages, then you should be able to apply it to each page individually and just change this line to give each one a unique subject line: var subjecttxt = "#" + timecode; Replace # with whatever you want the subject to be prior to the timecode/date.
  4. @TheMissingPastry 1. Put a form on the page. 2. Edit the order of the form fields to put the subject field at the very top. 3. Save your changes. 4. Go to Page Settings > Advanced for the page with the form on it and paste all of the code from <script> to </script> into the page header code injection area. That’s it. You should see the subject field when editing the page, but not when viewing it as a user. Submit a test of your form and it should have a unique # at the end now.
  5. @paul2009 Is correct. I thought the original subject field was different than the one you can add for some reason, but I went and tested mine and it worked just find with a new text field with a label of 'Subject'.
  6. @Jenny_M The subject field is automatically created when you add a new form. You need to use that original subject field. You can't delete it and try to create your own later.
  7. I use a similar method as Mochi, but I use Javascript to autofill the Subject field with a Unix Timestamp giving me a unique number at the end of each subject, then I set the CSS value of the form Subject field and it's Label to none, making it invisible to the user. The Subject field has to be the first field of the form for this to work, as it has no defining attributes, so this simply modifies the 1st field. Seems to be working so far. PAGE HEADER CODE INJECTION <script> $(document).ready(function(){ var timecode = Date.now(); var subjecttxt = "#" + timecode; $('form').find("input[type=text], text").each(function() { if(!$(this).val()) { $(this).attr("value", subjecttxt); $(this).attr("readonly", true); $(this).css("display","none"); var val = subjecttxt; return ( val !== subjecttxt ); } }); }); $(document).ready(function(){ $('form').find("label[class=title]").each(function() { if(!$(this).val()) { $(this).css("display","none"); var val2 = "none"; return ( val2 !== "none" ); } }); }); </script>
×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.