How to use a javascript command in the Image Checkbox Widget

  • Profile Image
    natupote
    Asked 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
    beril
    Answered 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
    natupote
    Answered 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

    http://natupote.net16.net/SALADA_NO_POTE.html

     

    thanks for help!

  • Profile Image
    Boris
    Answered 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.