0

I have a form with two yes/no radio buttons. Is it possible to create a validation for Freeform if the 'No' option is selected?

1 Answer 1

0

If you have a group of 2 radio buttons for Yes/No, as long as both radios have a value (lets say "on" and "off") then you can make the radio button required. Make sure the radios have the correct name attribute.

If the radio is in fact 1 radio button with on = yes off = no, then you'll have to add a hidden input with the no value in it, so that when the form is submitted there is at least a value for the named post variable.

2
  • I need a validation for the 'No' option only. How would I do this using Freeform?
    – Andrew
    Jun 9, 2015 at 14:31
  • how do yuo wish to validate it? As its a radio button, it only has an on/off option, ergo a single radio button <input type="radio" value="on" name="myradio" /> either propogates through post as nothing (unselected) or myradio = 'on'... Perhaps if you could post a snippet and explain the validation you widh to perform in detail I can post a better answer?
    – Blatant
    Jun 9, 2015 at 14:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.