How Can I Disable Specific Radio Buttons in a Radio Button Field (Radio Group)?

  • ecosse3
    Asked on March 16, 2015 at 4:46 PM

    Hello. I have simple question.

     

    How can I do disabled option in radio button? I want that this option will be visible but anyone can't check it. It is possible? Just like "read only" mode.

     

    Regards!

  • abajan Jotform Support
    Replied on March 16, 2015 at 7:26 PM

    Unfortunately, there's no way to accomplish this functionality in the form builder. However, if the full source of the form is embedded in a web page, a script can be added to the same page to do this, as in this demo. If you look at the bottom of the page's source, you'll see the script.

    If you need further help with this, we'd be glad to provide it.

    Thanks

  • abajan Jotform Support
    Replied on March 16, 2015 at 8:38 PM

    Hi again,

    In case you wanted to disable multiple buttons in a radio group, here's another demo. Now, you may be wondering how to apply the scripts to your particular form. Let's revisit the first demo. First, you need to find out the ID of the radio button to be disabled (read-only would actually be a more correct term) Please see this guide on how to find field IDs. This is the jotform used in the demo. If you were to clone it and examine the properties of its radio group, you would see the following information:

    How Can I Disable Specific Radio Buttons in a Radio Button Field (Radio Group)? Image 1 Screenshot 20

    The ID indicated is that of the second radio button. That same ID appears on the second line of the script. So, whatever the ID of your jotform's radio button is would go there.

    Now, let's look at the script in the second demo. This time there are multiple IDs on line 2. As you would no doubt have guessed, those are the IDs of the "disabled" radio buttons. So, once again, it would just be a matter of substituting the IDs of your own form's radio buttons.

    If anything's unclear, please let us know.

    Thanks

  • ecosse3
    Replied on March 17, 2015 at 10:41 AM

    Everything is okay. ID of my field is #input_12_2, so my code will be like this, but where have I paste this PHP code?

    Thank you

  • ecosse3
    Replied on March 17, 2015 at 12:14 PM

    Everything working! Thank you very much for being so accurate help. JotForm is the best form builder which I've ever used!

  • BJoanna
    Replied on March 17, 2015 at 1:44 PM

    On behalf of my colleagues, you are welcome.

    Do get back to us if you have any questions.

    Thank you!

  • Senaid
    Replied on March 2, 2016 at 6:32 AM

    Hey guys! Is it possible to extend that little script with a condition?

    For example:

    If I check Option 1 then Option 2 is disabled.

     

    I'm not really into scripting, so I would be really grateful for your support!

    Thank you!

  • Charlie
    Replied on March 2, 2016 at 9:13 AM

    @Senaid

    To better assist you, I have opened a separate thread for your concern. Please refer to this link instead: http://www.jotform.com/answers/785571. We will address it accordingly. Thank you.