Can autocapitalize be turned off with javascript in mobile safari?


Can autocapitalize be turned off with javascript in mobile safari?



Mobile safari supports an attribute on input elements called autocapitalize [documented here], which when set to 'off' will stop the iPhone capitalizing the text input into that field, which is useful for url or email fields.

<input type="text" class="email" autocapitalize="off" /> 

But this attribute is not valid in html 5 (or another spec as far as I know) so including it in the html will produce an invalid html page, what I would like to do is be able to add this attribute to particular fields onload with javascript with something like this:

$(document).ready(function(){   jQuery('input.email, input.url').attr('autocapitalize', 'off'); }); 

which adds the correct attribute in firefox and desktop safari, but doesn't seem to do anything in mobile safari, any ideas why?


How to add a breakpoint to objc_exception_throw?

1:

How to specify an beginTime for an animation by using CFTimeInterval?
This should be fixed in iPhone OS 3.0. iPhone web application development [closed] What version of iPhone OS are you endeavor this on?. Reload model for UITableViewController before [tableview reloadData]
Email: <input id="email" type="text"><br> URL: <input id="url" type="text"><br> <script> //document.receive ElementById("email").autocapitalize = 'off'; //document.receive ElementById("url").autocapitalize = 'on'; document.receive ElementById("email").setAttrialthough e('autocapitalize', 'off'); document.receive ElementById("url").setAttrialthough e('autocapitalize', 'on'); alert(document.body.innerHTML); </script> 
When should you NOT use the asterisk (*) when declaring a variable in Objective CiPhone/Android Dev for Pocket Change?

2:

Best Security Framework to secure and authenticate an iPhone app which uses REST?
Side note. How to determine UIWebView height based on content, within a variable height UITableView?You must improve the user experience on iOS even more by specifying the type of the input to be "email" to automatically bring up the "email" keyboard (slightly better characters for typing an email)..
<input type="email" class="email" autocapitalize="off" /> 
Here is any documentation on how input types must control the iOS keyboard..

3:

It's just as invalid if you add it via script or if you add it in the markup. It's just this the validator isn't able to notice it if you add it via script.. Just put it in the markup and put a comment next to it, like <!-- the "autocapitalize" attrialthough e is an Apple proprietary extension for the iPhone to change its IME behaviour -->, this way people who look at the code in the validator will know what's up..

4:

If it is a useful feature, you'll just have to pick between strict validation and user experience. Personally, I'd pick UX any day..

5:

So I couldn't receive jQuery to did it although plain old javascript, as ddkilzer suggested works, so I put toreceive her this function to apply the autocapitalize='off' option to all inputs with a specific class:.
$(document).ready(function(){   // disable autocapitalize on .url, .email fields   unautocapitalize('url');   unautocapitalize('email'); });  function unautocapitalize(cssClass){   var elems = document.receive ElementsByClassName(cssClass);   for (var j = 0; j < elems.length; j++){     elems[j].setAttrialthough e('autocapitalize', 'off');   } } 


60 out of 100 based on 35 user ratings 270 reviews