+ 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.
4 odpowiedzi
+ 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>
+ 6
welcome bro 💙
good luck 💙
+ 3
thank you :D
+ 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