-
Chris BarthAsked on July 25, 2024 at 9:51 AM
I have a set of data that I'd like prepopulate into a dropdown box. The data will likely be too extensive to fit in a URL. Can I call to build the embedded form with a JS object that includes the data needed for the dropdown?
-
Princess JotForm SupportReplied on July 25, 2024 at 11:40 AM
Hi Chris,
Thanks for reaching out to Jotform Support. Can you please try the following embed codes? What I did was I set the value of the field manually and added them to the Generated URL on the embed codes. For example, in Script embed code, the original code was:
<script type="text/javascript" src="https://form.jotform.com/jsform/242064672070047"></script>
and I updated it to include the field value already on the embed code:
<script type="text/javascript" src="https://form.jotform.com/jsform/242064672070047?dropdown=TestDropdown2"></script>
I have also attached screenshots when I tried these codes on my test site. Please see below:
When trying to embed using Script:
<script type="text/javascript" src="https://form.jotform.com/jsform/242064672070047?dropdown=TestDropdown2"></script>
When trying to embed using iframe:
<iframe
id="JotFormIFrame-242064672070047"
title="17264951 - Dropdown Prefill"
onload="window.parent.scrollTo(0,0)"
allowtransparency="true"
allow="geolocation; microphone; camera; fullscreen"
src="https://form.jotform.com/242064672070047?dropdown=TestDropdown3"
frameborder="0"
style="min-width:100%;max-width:100%;height:700px;border:none;"
scrolling="no"
>
</iframe>
Give it a try and let us know if you have any other questions.