Pattern not working, Pattern is not limiting the number of elements |
Pattern not working, Pattern is not limiting the number of elements |
spalisetty |
Aug 2 2020, 10:24 AM
Post
#1
|
Novice Group: Members Posts: 22 Joined: 2-August 20 Member No.: 27,469 |
Hello,
I have written the code to make sure that the number of characters is between 5 to 10. But it is going beyond and when I click on Register, it is going to different page as well. Kindly let me know where I am going wrong. <!DOCTYPE html> <html lang="en" dir="ltr"> <head> <meta charset="utf-8"> <title>Registration form</title> </head> <body> <form class="" action="ThankYou.html" method="Get"> <h1>Registration form</h1> <h2>All Fields are Mandatory</h2> <label for="uname">Name</label> <input id = "uname" type="text" name="username" placeholder="Enter Name" pattern=".{5, 10}" title="Please enter a name between length 5 and 10" required><br> <label for="uemail">Email</label> <input id = "uemail" type="email" name="email" placeholder="Enter Email" required><br> <label for="uage">Age</label> <input id = "uage" type="text" name="age" placeholder="Enter Age" required><br> <h2>Are you interested in Dating?</h2> <label for="yessir">Yes</label> <input id = "yessir" type="radio" name="dating" value="Yes"> <label for="nosir">No</label> <input id = "notesir" type="radio" name="dating" value="No"> <h2>Your expectation like</h2> <select class="" name="expectation"> <option value="actress1">sumalatha</option> <option value="actress2">suhasini</option> <option value="actress3">jayasudha</option> <option value="actress4">jayaprada</option> </select> <h2>How many Marriages you want?</h2> <select class="" name="numberofmarriages"> <option value="numberofmarr1">1</option> <option value="numberofmarr2">2</option> <option value="numberofmarr3">3</option> <option value="numberofmarr4">4</option> </select> <h2>Are You Heavy Alcoholic</h2> <label for="yesalcohol">Yes</label> <input id = "yesalcohol" type="checkbox" name="alcohol" value="Yesal"> <label for="noalcohol">No</label> <input id = "noalcohol" type="checkbox" name="alcohol" value="Noal"> <label for="somealcohol">Some Times</label> <input id = "somealcohol" type="checkbox" name="alcohol" value="soal"> <h2>Your Preferences and Extra Information</h2> <<textarea name="box" rows="8" cols="80"></textarea> <input type="submit" name="submit" value="Register"> </form> </body> </html> |
Lo-Fi Version | Time is now: 26th April 2024 - 08:57 PM |