What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    Is it possible to change the image URL in the form through a URL parameter?

    Asked by nickbh on September 04, 2015 at 06: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

     

  • Profile Image
    JotForm Support

    Answered by Welvin on September 04, 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:

    http://www.jotform.com/help/268-How-to-Insert-Text-or-Mathematical-Caculation-into-a-field-using-a-Condition

    Please share us the form in question so we can check it.

    Thanks

  • Profile Image

    Answered by nickbh on September 04, 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

     

  • Profile Image

    Answered by nickbh on September 04, 2015 at 01: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

     

  • Profile Image
    JotForm Support

    Answered by Welvin on September 04, 2015 at 02: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.

    http://www.jotform.com/help/316-How-to-show-or-hide-a-field-in-the-form-based-on-the-other-field-input-or-selection 

    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

  • Profile Image

    Answered by nickbh on September 06, 2015 at 08: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

     

     

     

  • Profile Image
    JotForm Support

    Answered by jonathan on September 06, 2015 at 02: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.