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

    How to use a javascript command in the Image Checkbox Widget

    Asked by natupote on June 22, 2016 at 02:03 AM

    Hello everyone and sorry my english


    i want use a comand in javascript similar to onclick in the image checkbox widget

    when a option is selected, a alert text will shown in the screen, i can do that using the radiobuttons, but now i want learn how to use that funcion in the image checkbox widget.

    Script to use with radiobuttons is below

    <input type="radio" id="grupo1" name="grupo1" value="Esquerda" onclick= "alert(''TESTE DE TEXTO')"" checked>Alinhamento à esquerda<br>

    Thanks for read!

  • Profile Image
    JotForm Support

    Answered by beril on June 22, 2016 at 04:18 AM

    I am sorry to say that, it is not possible to add javascript code in your widget. If you provide more details about your workflow we can help you with different way. We will wait for your response.

  • Profile Image

    Answered by natupote on June 22, 2016 at 01:12 PM

    I embed the source code of my form in another server, and i add succefully javascript code to default radiobuttons of the form, and i need use the same javascript code on the image checkbox widget

    the link to my form is below, the radiobutton with the javascript code is the option ""VITOR" in the page 2, he's with the javascript funtion onclick



    thanks for help!

  • Profile Image

    Answered by Boris on June 22, 2016 at 03:01 PM

    I'm afraid it is not possible to add any custom JavScript scripts into our widgets, such as the Image Checkbox widget, as they are being loaded in separate iFrames inside the main form.

    If you need to add custom scripts, they can only be added for regular form fields (not for widgets), and only when using the source code of your form (which you are already using).

    For the reason listed above, you may want to use a regular Check Box field instead of the Image Checkbox widget, in case you want to apply custom scripts to the options. Please let us know if you need any further clarifications or assistance, we'll be happy to help.