elclanrs / jq-idealforms-old

The ultimate framework for building and validating responsive HTML5 forms.
665 stars 95 forks source link

How to required radio button? #91

Closed cartouche699 closed 11 years ago

cartouche699 commented 11 years ago

Hello,

First thank you for your very useful plugin.

I have one question : How to required radio button? HTML code:

What do I have to write in var options = { inputs: {

Thank you

elclanrs commented 11 years ago

You have to use the min filter. Check the example for more info.

<div>
  <label>Sex:</label>
  <label><input type="radio" name="sex"/>Male</label>
  <label><input type="radio" name="sex"/>Female</label>
</div>
inputs: {
  'sex': {
    filters: 'min',
    data: { min: 1 }
  }
}