+ 1

¿Anyone knows if pattern attribute works without js?

I was wondering if the validation of the pattern attribute works in a browser that does not supports js (or has it locked). Sorry for my bad english.

22nd Mar 2018, 4:01 PM
Ohtli García
Ohtli García - avatar
4 Antworten
+ 8
yeah of course, like that: <form action="/action_page.php"> Country code: <input type="text" name="country_code" pattern="[A-Za-z]{3}" title="Three letter country code"> <input type="submit"> </form>
22nd Mar 2018, 4:36 PM
Baraa AB
Baraa AB - avatar
+ 6
welcome bro 💙 good luck 💙
22nd Mar 2018, 9:15 PM
Baraa AB
Baraa AB - avatar
+ 3
thank you :D
22nd Mar 2018, 5:05 PM
Ohtli García
Ohtli García - avatar
+ 1
you can use pattern attribute on input elements like <input type='text' name='age' pattern=/[0-9]{2}/ placeholder='your age'/> html5 will validate it automatically on submission
22nd Mar 2018, 4:29 PM
Prateek Narang
Prateek Narang - avatar