The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Pattern not working, Pattern is not limiting the number of elements
spalisetty
post 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>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic
spalisetty   Pattern not working   Aug 2 2020, 10:24 AM
pandy   What do you mean it goes to a different page as we...   Aug 2 2020, 11:25 AM
spalisetty   Hello, I have written the code to make sure that ...   Aug 2 2020, 12:28 PM
pandy   Oh, now I understand. Are you sure the regex is co...   Aug 2 2020, 01:30 PM
spalisetty   Oh, now I understand. Are you sure the rexex is c...   Aug 2 2020, 01:38 PM
Christian J   Seems the space is causing problems: .{5, 10} whil...   Aug 2 2020, 01:18 PM
spalisetty   Seems the space is causing problems: .{5, 10} whil...   Aug 2 2020, 01:38 PM
pandy   Seems the space is causing problems: Duh. Thou...   Aug 2 2020, 02:20 PM
Christian J   Are you good as this? No. :wacko: You mean ...   Aug 2 2020, 02:29 PM
pandy   Nothing specific, but more than ANSI anyway. Say I...   Aug 2 2020, 04:43 PM
Christian J   To me it seems Regex is a power tool for those usi...   Aug 2 2020, 05:47 PM
pandy   To me it seems Regex is a power tool for those us...   Aug 2 2020, 08:28 PM
pandy   Add o that there are oodles of flavours of regexp....   Aug 2 2020, 09:06 PM
pandy   Add to that there are oodles of flavours of regexp...   Aug 2 2020, 09:06 PM
pandy   From https://stackoverflow.com/questions/150033/.....   Aug 3 2020, 07:59 AM
Christian J   Get that into pattern! :D :D :D :wacko: ...   Aug 3 2020, 12:30 PM
pandy   Are you sure it doesn't rely on JavaScript? Wh...   Aug 3 2020, 03:36 PM
Christian J   Are you sure it doesn't rely on JavaScript? ...   Aug 3 2020, 04:25 PM
pandy   I know, but disabling JS probably just means scrip...   Aug 3 2020, 05:31 PM
pandy   And here I found one we can use if we want to be s...   Aug 3 2020, 08:39 PM
pandy   This actually made me find my regexp book and flic...   Aug 3 2020, 08:48 PM
Christian J   And here I found one we can use if we want to be ...   Aug 4 2020, 07:32 AM
pandy   I'm too fast. I'm on lesson 4 already. I w...   Aug 8 2020, 01:03 AM
Darin McGrew   I think that's the key for regular expression...   Aug 4 2020, 08:24 AM
pandy   Yeah, different flavours are a stumble stone for m...   Aug 4 2020, 10:39 AM
Christian J   You could always add to the library of PATTERN att...   Aug 4 2020, 11:03 AM
pandy   I don't think my attempts should be trusted. ...   Aug 4 2020, 01:47 PM
Christian J   Nothing to worry about, considering the constant p...   Aug 5 2020, 05:45 PM
pandy   You should write one. :rolleyes:   Aug 5 2020, 06:31 PM
pandy   Or we just leave it to Darin. :lol:   Aug 5 2020, 07:42 PM
Christian J   Out of how many lessons? :-p Here's a challen...   Aug 8 2020, 10:12 AM
pandy   10. But I expect the remaining chapters to take lo...   Aug 8 2020, 10:04 PM
Christian J   In lesson 4 I learnt this [code]\w matches a...   Aug 9 2020, 07:14 AM
pandy   That looks like any character you can use between...   Aug 9 2020, 07:36 AM
Christian J   But I still don't see how the underscore fits...   Aug 9 2020, 12:08 PM
pandy   I meant in neither of them, the second is just a n...   Aug 9 2020, 12:20 PM
pandy   https://stackoverflow.com/questions/4953390....   Aug 9 2020, 12:56 PM
pandy   There's actually a whole extra help file for r...   Aug 9 2020, 01:17 PM
pandy   Here is something both good and bad. Many engines ...   Aug 10 2020, 11:13 AM


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 26th April 2024 - 08:57 PM