+ 1

How do I create a form where a particular alphabet must be required , where a user must write that particular alphabet

<form action="action_page.php"> <label for="fname">What color is the sky</label> <input type="text" id="fname" name="firstname" placeholder="Skye color..." required> </form> Let’s say I want a user to type a particular alphabet, if a wrong alphabet is typed in the box if should show and error message

1st Apr 2018, 11:08 AM
klisco1
1 Réponse
0
Hi kilisco1 you can use pattern with a regular expression https://www.w3schools.com/tags/att_input_pattern.asp which you can build here http://html5pattern.com/
1st Apr 2018, 12:25 PM
Mike Choy
Mike Choy - avatar