When I add the 'Required' attribute
to html input fields, Rails pre-pends an asterisk (*) before the label.
Does anyone know how to prevent this?
For some reason Rails transforms this:
<%= f.input :Company, :input_html => {:value => "", :id => "company_name"}, :label => "company name" %>
into this:
<div class="input string required"> <label for="company_name" class="string required"> <abbr title="required">*</abbr> company name</label> <input type="text" value="" size="50" required="required" name="lead[Company]" id="company_name" class="string required"> </div>
I don't like that it wraps everything in a DIV and adds an ABBR element to the party.
How can I prevent this?
Removing the Required AsteriskGo to Style > Text > Text Options and uncheck the option Show Required Asterisks.
Fields marked with * are mandatory Using an asterisk (*) symbol content authors notify mandatory field. This is said to be one of the accessible modes of identifying a mandatory field, however this method also will be a problem with screen readers in certain times.
You can just set the required mark to empty value in simple_form's locale file:
en: simple_form: required: text: 'required' mark: '*'
Or use CSS to hide it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With