16

In my custom module I have a form which has radio buttons.

When I click the submit button it does not validate the radio button.

How to validate that using the Magento default validate class.

Thanks

John Powell
  • 12,253
  • 6
  • 59
  • 67
MeenakshiSundaram R
  • 2,837
  • 3
  • 29
  • 41

2 Answers2

42

i got the answer,

use validate-one-required-by-name in the class name of the radio button.

Cheers

Edit:

or

use validate-one-required on the last radio/checkbox in the group

Thanks to Rahul Tripathi

Community
  • 1
  • 1
MeenakshiSundaram R
  • 2,837
  • 3
  • 29
  • 41
0

Validation works, but to show error message you can't use any wrappers. Just

 <label> and <input>
AlexanderPop
  • 141
  • 1
  • 3