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

    Image Checkbox Widget: How to extract current state in Javascript

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

    Hello everyone and sorry my english

     

    I'm creating a script in javascript on my form, and i need use the info to the current state of the checkbox widget for a condition, how i print the current state in javascript?

     

    Thanks again!

  • Profile Image
    JotForm Support

    Answered by EltonCris on June 22, 2016 at 03:27 AM

    Hi there!

    Your English is fine, however, it is not possible to inject or use javacript in the form builder or in the widgets. The form builder will strip off the javascript codes for security reasons. 

    However, if you could please tell us what you want to achieve, we might be able to find a workaround for you. Kindly provide more details about your goal with the image checkbox widget so we can further assist you here.

  • Profile Image
    JotForm Support

    Answered by EltonCris on June 22, 2016 at 03:34 AM

    By the way, if you want to extract the value of the selected option on image checkbox widget, you can use the UPDATE/CALCULATE FIELD condition.

    Example:

     

     

    Demo: https://form.jotform.com/61731994699980

    You can also clone this form if you want.

  • Profile Image

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

    I understand, thanks, but i host my form in a external server, and i add with sucess a javascript code in the default radiobutton, but now i need put the same function in the Image checkbox widget, can you help me? The link of my form is below, the radiobutton with the javascript funtion is in the page 2, option "VITOR", i need put a onclick event in the ImageCheckboxWidget.

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

     

    Thanks for help!

  • Profile Image
    JotForm Support

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

    As explained by my colleague above and in your previous thread ( https://www.jotform.com/answers/866354 ), it is not possible to add custom scripts within our widgets.

    Even when using the source code method to customize the form, widgets are still being loaded directly from our own servers, within an iFrame. As such, it is not possible to add custom scripts to the widgets - you can only add custom scripts to regular form fields on your form, when embedding it with source code embed method:

    https://www.jotform.com/help/104-How-to-get-the-Full-Source-Code-of-your-Form

    If you need to add any custom scripts, please try using a regular Check Box field instead of the widget. If you need further clarifications or assistance, please let us know.