Ruby on Rails Friday, October 17, 2014

Hi,

I need to add a required class in gender radio button. How this can be done.

<td colspan="2">
<label for="stay_connected_form_gender">I am <span class="astris">*</span></label>
<%= f.radio_button :gender, 'm', :class => 'RadioInput' %>Male
<%= f.radio_button :gender, 'f', :class => 'RadioInput' %>Female
</td>

classname  = required

If I am adding like this then it display two validation message for each radio button.

<%= f.radio_button :gender, 'm', :class => 'RadioInput required' %>Male
<%= f.radio_button :gender, 'f', :class => 'RadioInput required' %>Female

I need to get a single validation msg if none of the radio button is selected.


Thanks in advance .......

Best Regards,

Gopinath M


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAPDEix%2BKML8mjXL-24JBp8D4Ej03tqhSMn%3DfVnyqvJhL5PdtFw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment