For example, type = "number" specifies that the input tag expects a number. In general this is great as it permits client side validation, but it can have some side effects in some cases.
The specific case that is causing me problems occurs in the Google Chrome browser when it handles integers entered into an input element with type = "number".
Rather than simple displaying the integer, Chrome inserts commas into the number.
For example, 123456789 becomes 123,456,789
The commas are not included when the form is submitted but they are there if I cut and paste the text.
I don't want these - if I give it an integer all I want to see if the integer. But there is no readily accessible option in Chrome to disable this feature.
The workaround is to explicitly set the type to text (type = "text"). You lose the client side validation but you avoid the commas.
Now, I write Rails applications and use the simple_form gem to help create forms. This knows about the types of input each form input is going to accept and so it liberally uses the 'type' attrbutes. Fortunately you can override these as follows:
<%= f.input :myinteger, :input_html => { :type => 'text'} %>
2 comments:
Good news! Looks like time has come to change my browser on Chrome ;)
homework help
New Launch to make changes..!
We believe that This is time to change and Now we gone make changes in our HTML format which is something important for us in concern of Google Chrome browser.
Thanks for sharing...!
WildCard SSL
Post a Comment