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:
how go writing vanilla js or jquery function replicates pattern's functionality?
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:
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
Post a Comment