- HubbleandHattieAsked on April 25, 2017 at 11:01 AM
I want to pass parameters to two fields in a form, but all the code I've tried in the forums here fails to work.
I want to use a lightbox, but the code shown in this post:
I can't get this to work in any shape or form, and I notice that the code in the post doesn't match the current lightbox code I'm supplied with by JotForm form builder … it looks like the Feedback code, not the lightbox code.
Has anyone managed to implement this recently (that post was from 2011)? And got it working!?
- JotForm SupportWelvinAnswered on April 25, 2017 at 12:44 PM
I was able to add the parameter correctly. Would you mind letting us know the fields that you would like to populate in your form? We can help you set it up. The parameters are on the same placement, nothing changed there.
Here's my test page: http://shots.jotform.com/welvin/html/lightbox-with-parameters.html.
- HubbleandHattieAnswered on April 26, 2017 at 05:15 AM
I'm trying to populate two fields in this form:
The fields to fill are the first field 'Book SKU' and the second field 'Book title' (which have the names q4_bookSku and q5_bookTitle, respectively).
I've used the following code, where I've replaced the .com server with the eu server, and the two field names, but still no joy.
Checking the web inspector, I can the following syntax error:
… if that helps?!
The only method I can get to work, is that using the PrePopulate Fields app to give a straight link, thus:
I'm using that method for the moment, but I'd like to figure out how to pass the values for more dynamic embed methods.
- SvenAnswered on April 26, 2017 at 05:57 AM
I can see in your code that you have a comma after 'q5_bookTitle': 'Worzel says hello!', inside iframeParameters. This could be the cause of your code breaking, otherwise, your code seems correct and it should work without any issues.
Can you please try removing the comma and see if it helps, if the issue still persists, then please get back to us so we can assist you further.
- HubbleandHattieAnswered on April 26, 2017 at 06:03 AM
Comma removed … no joy :(
The syntax error is still present, too.
- SvenAnswered on April 26, 2017 at 07:18 AM
I just checked your code, you're using the wrong field name to assign values in your code.
Please try this code instead:
'bookTitle': 'Worzel says hello!'
windowTitle: 'Stock Notification Request', background: '#FFA500', fontColor: '#FFFFFF', type: 'false', height: 500, width: 700, openOnLoad: false }); </script>
<a class="btn lightbox-71143582065352" style="margin-top: 16px"> Notify me when stock arrives </a>
I just tested it on my test page and it worked perfectly.
Please see: http://safaaabdulhadi.000webhostapp.com/
I hope this fixes your issue, if you have any further questions, please get back to us so we can assist you further.
- Ultimate911Answered on April 26, 2017 at 09:03 AM
Sven, that's it! Took out the 'q#_' and it works perfectly.
I have another site to implement this on, so I'll ignore those initial characters in the field names and see if it works there.
Thanks for your help!