when a check box in my form is not validated, the check box and the
label are not anymore aligned... a hidden input field is added, which
gives a mess in the display....
<label>
<%= f.check_box(:accepted_terms, {:id => "user_accepted_terms"}
%>I
am over 14
</label>
<span class="error-with-field">
<% if @user.errors.on(:accepted_terms) %>
<span class="error"><%=
@user.errors.on(:accepted_terms) %></
span>
<% end %>
</span>
but the generated html is : (2 divs which leads to the check box and
the label on 2 lines)
<div class="fieldWithErrors">
<input id="user_accepted_terms" type="checkbox"
name="user[accepted_terms]"/>
</div>
<div class="fieldWithErrors">
<input type="hidden" value="0"
name="user[accepted_terms]"/>
</div>
I am over 14 years
<span class="error-with-field">
<span class="error">•You must confirm this
paragraph</span>
</span>
is there any way to avoid this problem ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---