How to pre-fill the checkbox, radio option and textbox over URL

  • Profile Image
    jonathan doughrety
    Asked on October 01, 2014 at 02:05 PM

    For the most part the prefill works, but for certain checkmark/bullet points it does not. For example, the following link does not work:

     

    http://form.jotform.us/form/42727008555153?=cfnOr[]=CFN

     

    What is the problem?

     

    Jonathan



    This is a re-post of a comment on Prepopulating Fields to Your Jotform via URL Parameters

  • Profile Image
    Ben
    Answered on October 01, 2014 at 03:17 PM

    Hi Jonathan,

    It works with checkboxes as well, but you need to use the number to reference it, the [] (square brackets) mean that there are multiple options available or expected so you need to use an ID number and all of them start from 0.

    For example, to reference the first checkbox 'CFN' we do this:

    http://form.jotform.us/form/42727008555153?cfnOr[0]=true

    To mark the CSE we do this:

    http://form.jotform.us/form/42727008555153?cfnOr[1]=true

    Notice that only the ID was changed.

    Now if you are passing a lot of values, you want to have the URL short and that is possible by changing the true to 1 - both will mark the checkbox as selected.

    Similar is with the false or 0 - making sure that the checkbox is not selected (in case you set it in your form as selected by default for example).

    Now if I see correctly you seem to be using Opera browser. In it you can see which ID number you should add by doing this:

    Right click on the page and then on Inspect Element, my suggestion is to do this close or above the element that you want to find info on.

    If you click on the image it will show bigger. To explain what is on the image. you can see the id="input_18_1". What we are interested is that last number. You can checked on the CFN option, it will be similar -> id="input_18_0".

    I hope that I was able to help you and please let us know if you have any further questions.

    Best Regards,
    Ben

  • Profile Image
    qualitypllc
    Answered on October 03, 2014 at 03:45 PM

    Thanks so much, that worked, I have one other problem though with respect to filling in the blank for Other language, and other blanks following the Other * option.

     

    For example, lets say I want language to be Other * and then fill in the text box to say French, if I use the following URL I will get the other box checked off, but the French will not populate the text box, any ideas on how to solve this issue?

     

    http://form.jotform.us/form/42727008555153?languageOf12=Other%20*&If=French

  • Profile Image
    Ben
    Answered on October 03, 2014 at 04:08 PM

    Hi,

    I am glad to hear that it worked for you. :)

    Now regarding the current issue.

    To select the checkbox/radio option we need to use its name and ID and then give it value. In this case it means

    ?languageOf12[13]=1

    We do not need to set all of the options as it is only 1 that can be selected and to mark it we give it true or 1.

    Regarding the other field, the problem there is the name. It can not be called 'If' it will just not accept the value (since 'if' is also a 'command', so it is dropped).

    You should change the name to something else, like "other_language" for example.

    I have did it on my jotform (clone of yours) http://form.jotformpro.com/form/42756141286962?languageOf12[13]=1&other_language=French

    To rename it you can follow these steps:

    right click on the text box widget and select Show Properties

    Now scroll down and double click on the name field to rename it

    As mentioned above, I would change it to something as "other_language"

    Do let me know if this helps you accomplish what you wanted :) and of course do ask if you need any further assistance.

    Best Regards,
    Ben

  • Profile Image
    qualitypllc
    Answered on October 06, 2014 at 12:08 PM

    The problem is that the link I sent you is actually the clone of one that I need to fill out.  I am unable to make changes to the properties of the original jot form.  Is there any way to pre-fill the other language textbox using the properties as they currently exist?

     

    Thanks so much,

     

    Jonathan

  • Profile Image
    Ben
    Answered on October 06, 2014 at 12:36 PM

    Hi Jonathan,

    Unfortunately no, it would not be possible to fill it out as it is. If the other jotform is in your account and you want them to be the same, you can either change the original and then clone it again or change the property on both jotforms.

    I am unable to make changes to the properties of the original jot form

    Do you get some error when you change it? Can you please give us a few more details about this?

    Best Regards,
    Ben

  • Profile Image
    qualitypllc
    Answered on October 07, 2014 at 11:49 AM

    The original jotform belongs to another entity, the link I posted above is a clone of that other entity's jotform.  I must frequently fill out that form with different info each time.  I am trying to figure out how to prefill with data I have in excel, so far I can prefill everything except that Other language text box (when applicable).  Is there any way to prefill that text box using the URL that doesnt involve me asking that entity to change the source code?

     

    Regards,

     

    Jonathan

  • Profile Image
    Kiran
    Answered on October 07, 2014 at 01:26 PM

    Unfortunately, it is not possible to prefill the data without changing the property of the field in this case. As explained by Ben, since it is a keyword we cannot use it as a name for a field in the form. Hence it is required to change the name of the field. Sorry for the inconvenience caused.

    Please let us know if you have any other questions. Thank you.

  • Profile Image
    mediatask
    Answered on September 28, 2016 at 10:19 AM

    Hi Everyone,

    I found this post while looking for a solution to a connected problem.

    It's actually directly connected to what Ben wrote avove:

    Similar is with the false or 0 - making sure that the checkbox is not selected (in case you set it in your form as selected by default for example).

    What if I want to use a prefill URL and uncheck a checkbox which is selected by default in the form?

    Is there a way to do that?

    Jacek

  • Profile Image
    Kiran
    Answered on September 28, 2016 at 12:11 PM

    @Jacek,

    Your question is moved to a separate thread and shall be addressed there shortly.

    https://www.jotform.com/answers/944292

    Thank you!