acornwell Posted March 27, 2015 Share Posted March 27, 2015 I'm using the Wells template and would like users to be able to click a link in a photo caption and be taken to a form where they can inquire about the image and the image number is pre-filled into a text field so the user doesn't have to remember what number to fill in there. In other words, a link looking something like this: http://xyz.com/contact?img=20150314_0048 The link goes to the "contact" page with a form where a text field for "img" is pre-filled with "20150314_0048". When I do a view source of the contact page, I see the text field has an ID of "text-yui-(string of numbers)-field" which is perhaps what I would need to reference in place of "img" in the URL link on each image? I tried that and nothing was pre-filled. Any suggestions? Link to comment
SquarespaceGuru Posted March 27, 2015 Share Posted March 27, 2015 Not without the developer platform, and not without a pretty advanced understanding of json/javascript...and really you would need access to the database to define this and that. Which is something I have yet to figure out how to do! I don't think the developer platform opens up access enough to the data needed. I could be wrong though! Also anytime you see a "yui" and a string of numbers, you need to know those change dynamically on each page load. I run the Squarespace Guru blog (www.sqsp.guru) and host the Squarespace Guru podcast. Link to comment
acornwell Posted March 27, 2015 Author Share Posted March 27, 2015 Thanks SquareSpaceGuru, I was afraid of that. I do have some json/javascript experience, but I was hoping for a simple solution. Link to comment
acornwell Posted March 27, 2015 Author Share Posted March 27, 2015 Thanks SquareSpaceGuru, I was afraid of that. I do have some json/javascript experience, but I was hoping for a simple solution. Link to comment
Guest Posted January 9, 2016 Share Posted January 9, 2016 you can do it this <input type="text" name="uniquecode" id="uniquecode" style="width: 350px;" class="input" value="" placeholder="Copy-Paste your Code"/> <script type="text/javascript"> window.onload=function(){ function querySt(ji) { hu = window.location.search.substring(1); gy = hu.split("&"); for (i=0;i<gy.length;i++) { ft = gy[i].split("="); if (ft[0] == ji) { return ft[1]; } } } var uc = querySt("uc"); if( uc==null){ }else{ document.getElementById('uniquecode').value = uc; } } </script> then I can input an URL such as: http://www.xyz.com/page?uc=sometextformyform This work but I am looking to do that with squarespace product / popup forms if anyone knows? Link to comment
PeterCBlanchard Posted January 6, 2017 Share Posted January 6, 2017 @acornwell This is over my head, but maybe this will help you?https://support.squarespace.com/hc/en-us/articles/206543997 Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.