javascript - How do I duplicate the "pattern" attribute for Safari? -


i've got client online store that's having issues customers putting emojis , special characters text input field. want them able use spaces, numbers, letters, , letters accents , umlauts , such. when tried solution, worked.

pattern="[ a-zÀ-ÿ0-9]" 

problem is, works every browser we've tested on except safari. i'm serious javascript n00b; i've written jquery , javascript functions myself have done i've needed them do, problems twofold:

  1. how go writing vanilla js or jquery function replicates pattern's functionality?

  2. more importantly (because possible solutions i've seen have omitted information), how link input works in first place?

thank can give me!

fixed! answer startlingly easy. polyfill, per site:

http://www.useragentman.com/blog/2010/07/27/creating-cross-browser-html5-forms-now-using-modernizr-webforms2-and-html5widgets-2/

here's code used. turns out other dev had added entire modernizr.min.js script fix problem.

<script type="text/javascript" src="/path/js/modernizr-2.5.3.forms.js"></script>  <script type="text/javascript" data-webforms2-support="validation" src="/path/js/html5forms.js" ></script> 

links both sites download both modernizr , html5 forms, convenience of users same problem.

https://modernizr.com/download?setclasses&q=input%20pattern https://github.com/zoltan-dulac/html5forms.js/tree/master


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -