-
nickbhAsked on September 4, 2015 at 6:25 AM
Is it possible to dynamically change an image on the form (ie its url location)
Ie can I prepopulate a field and reference that field to identify the location of the image.
Ie pass URL location when loading the form?
Thanks
Nick
-
Welvin Support Team LeadReplied on September 4, 2015 at 10:37 AM
Hi Nick,
Well, for prepopulating a field, that is possible.
http://www.jotform.com/help/71-Prepopulating-fields-to-your-JotForm-via-URL-parameters
For referencing the prepopulated field, you can use our calculation widget. In this case, you need to conditionally do it:
Please share us the form in question so we can check it.
Thanks
-
nickbhReplied on September 4, 2015 at 11:27 AM
Hi,
Thanks for the reply. I am familiar with both tutorials.
What I am trying to do is update the image on the form by passing a URL parameter.
Ie, in the middle of the form I have an image of an apple (eg www.myimages.com/apple.jpg).
When I call the form I want to pass a new image location (eg www.myimages.com/orange.jpg) so that the form loads up the Orange image instead of the apple.
What I am asking- is it possible to change the image through a URL parameter?
Many Thanks
-
nickbhReplied on September 4, 2015 at 1:01 PM
Alternatively can you include a reference to a field in the image URL?
eg www.myimages.com/{textinput_23}.jpg
where textinput_23 is a prepopulated hidden field in the form?
Thanks
-
Welvin Support Team LeadReplied on September 4, 2015 at 2:43 PM
Unfortunately, I don't think this is possible. I did try looking for a direct method to achieve this in the form, no avail. A workaround would be to add the images in the form and show each based on the previous field data - that is through conditional logic.
Here's example form, http://www.jotformpro.com/form/52463853327964. Type "black" or "orange" in the Image Param field to view the images.
Then you can do the URL parameter:
http://www.jotformpro.com/form/52463853327964?imageParam=black
http://www.jotformpro.com/form/52463853327964?imageParam=orange
I hope this works for you.
Thanks
-
nickbhReplied on September 6, 2015 at 8:12 AM
Hi
Thanks for the workaround. Not sure this will work however as I may have over 200+ images and the locations may change on the form depending on another parameter - so I could potentially have to create over 1000 images.
I will have to consider if there is another workaround.
Any other suggestions would be very welcome.
Many Thanks
-
jonathanReplied on September 6, 2015 at 2:14 PM
I think that using the form's source code embed and then use javascript code to dynamically affect the fields (i.e make them read-only) can also work.
If I understand correctly, the reason you were trying to come up on this workaround because you were using for a workaround on the pre-populated slider you mentioned on this thread
http://www.jotform.com/answers/655843-Update-Slider-Value-by-URL-Parameter
Hope this help. Let us know if you need further assistance.