473,662 Members | 2,666 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Validation control problem

I am using a Regular Expression Validator and expression ^.{4,8}$ but even
when I type in "asdf",
"1234", or "asdf1234" when I click on the submit button it keeps giving me
the error "Password must be between 4 and 8 characters in length". What did
I do wrong in the following Page1.aspx ? Thank you.

<body>
<form id="form1" runat="server">
<div>
<input id="txtPassword " runat=server type="password" />&nbsp;
<asp:RegularExp ressionValidato r ID="RegularExpr essionValidator 1"
runat="server" ControlToValida te="txtPassword "
ErrorMessage="P assword must be between 4 and 8 characters in length"
ValidationExpre ssion="^.{4,8}$ "></asp:RegularExpr essionValidator >
<br />
<asp:Button ID="txtSubmit" runat="server" Text="Submit" /></div>
</form>
</body>
Apr 27 '07 #1
3 1134
I copied your code verbatim into a project and it appears to work fine for
me.

--
Page Brooks
www.explosivedog.com
"fniles" <fn****@pfmail. comwrote in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
>I am using a Regular Expression Validator and expression ^.{4,8}$ but even
when I type in "asdf",
"1234", or "asdf1234" when I click on the submit button it keeps giving me
the error "Password must be between 4 and 8 characters in length". What
did
I do wrong in the following Page1.aspx ? Thank you.

<body>
<form id="form1" runat="server">
<div>
<input id="txtPassword " runat=server type="password" />&nbsp;
<asp:RegularExp ressionValidato r ID="RegularExpr essionValidator 1"
runat="server" ControlToValida te="txtPassword "
ErrorMessage="P assword must be between 4 and 8 characters in length"
ValidationExpre ssion="^.{4,8}$ "></asp:RegularExpr essionValidator >
<br />
<asp:Button ID="txtSubmit" runat="server" Text="Submit" /></div>
</form>
</body>


Apr 27 '07 #2
Ironic how I was just asking for help myself but I think the validator is
only seeing parting of the expression.
I would try this ^[.]{4,8}$ and note we can test the validation much faster
in the page by tabbing out of the textbox.

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee. com
URL http://clintongallagher.metromilwaukee.com/


"fniles" <fn****@pfmail. comwrote in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
>I am using a Regular Expression Validator and expression ^.{4,8}$ but even
when I type in "asdf",
"1234", or "asdf1234" when I click on the submit button it keeps giving me
the error "Password must be between 4 and 8 characters in length". What
did
I do wrong in the following Page1.aspx ? Thank you.

<body>
<form id="form1" runat="server">
<div>
<input id="txtPassword " runat=server type="password" />&nbsp;
<asp:RegularExp ressionValidato r ID="RegularExpr essionValidator 1"
runat="server" ControlToValida te="txtPassword "
ErrorMessage="P assword must be between 4 and 8 characters in length"
ValidationExpre ssion="^.{4,8}$ "></asp:RegularExpr essionValidator >
<br />
<asp:Button ID="txtSubmit" runat="server" Text="Submit" /></div>
</form>
</body>


Apr 27 '07 #3
I use ^.{4,8}$ in another project and it works. I don't know why it
did not work in the other project. THank you for your help.

On Apr 27, 3:06 pm, "clintonG" <nob...@nowhere .comwrote:
Ironic how I was just asking for help myself but I think the validator is
only seeing parting of the expression.
I would try this ^[.]{4,8}$ and note we can test thevalidationmu ch faster
in the page by tabbing out of the textbox.

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee. com
URLhttp://clintongallaghe r.metromilwauke e.com/

"fniles" <fni...@pfmail. comwrote in message

news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
I am using a Regular Expression Validator and expression ^.{4,8}$ but even
when I type in "asdf",
"1234", or "asdf1234" when I click on the submit button it keeps giving me
the error "Password must be between 4 and 8 characters in length". What
did
I do wrong in the following Page1.aspx ? Thank you.
<body>
<form id="form1" runat="server">
<div>
<input id="txtPassword " runat=server type="password" />&nbsp;
<asp:RegularExp ressionValidato r ID="RegularExpr essionValidator 1"
runat="server" ControlToValida te="txtPassword "
ErrorMessage="P assword must be between 4 and 8 characters in length"
ValidationExpre ssion="^.{4,8}$ "></asp:RegularExpr essionValidator >
<br />
<asp:Button ID="txtSubmit" runat="server" Text="Submit" /></div>
</form>
</body>- Hide quoted text -

- Show quoted text -

Apr 28 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
6291
by: Matt | last post by:
I want to know if ASP.NET Web Forms Validation Controls are Server-Side or Client-Side form validation? Since I think each validator control can select either 1) JavaScript based error dialog or 2) show the error message next to the control. For example, if the text field is empty with RequiredField Validator control, it can show the value in ControlToValidate property in two ways as I mentioned. Please advise. Thanks!
3
2996
by: Ben | last post by:
Hi, I have a page with a datagrid that you have to scroll to see. I'm using the StrengthControls SmartScroller as recommended to maintain my scroll position. Anyway, inside the datagrid I have fields that require validation. No problem, I put the validators on them and they work just fine... Except for the fact that when a user has an invalid entry and fires a validation event client side the scroll position is reset to the top of the...
2
3995
by: Martyn Fewtrell | last post by:
Dear All I have a Windows 2003 Server with IIS6 where the validation controls on ASP.Net pages no longer work. I believe it to be specific to the server as if I create an ASP.Net page on the IIS Server of my Workstation (Win XP) with a text box, button and required field validator, this works fine. If I create the same page on the IIS6 Windows 2003 Server the validation control doesn't stop the post. I've tried different browsers and...
5
3239
by: Chris | last post by:
Based upon some prevoius postings on what to do for adding a 'add' row to a datagrid I utilize the footer to create the 'add' row. The only issue is that I have it sharing the 'UpDate_Command' and I use an argument to difference between an 'edit' vs. and 'add. But since I have field validation on both 'footer' and 'edit' columns I can't submit my edits since the footer validation kicks in.If I take the validation off then the both work fine...
9
3176
by: Bill Long | last post by:
I have a control that simply displays a list of links. Following one of the links doesn't post back or redirect to another page, it simply hides the current panel and shows the one you selected... So the behavour is similar to a tab control. The user is expected to fill out required data on each of the panels before pressing a submit button which is visible from all panels. Problem I have is validating the data entered by the user. I...
5
2049
by: Tina | last post by:
the Edit, Update, Cancel, and Delete buttons in my datagrid are causing validation elsewhere on the page. I want to specify that these buttons should not cause validation but they have no design time property of causevalidation. How can I keep them from causing validation? Thanks, T
2
6702
by: Tim Frawley | last post by:
Source code attached indicates my problem with validation and a button bar save button. Fill the Textbox with some text then tab off the control. The message box will display the text in the textbox from the Validating event. Now put the focus back on the textbox click the button bar button. Nothing happens. The form causes validation is true, so is the button bar and the control.
4
1547
by: Lloyd Dupont | last post by:
I am writing a 'blog control' which, amongst other things, let you edit some HTML text. When it's submited back there are validation problem and to my... *Horrible Disbelief* it seems I can only enable/disable control validation on the whole page, I found no way to do it on a per control basis! I mean, come on, I would like to keep the default validation control behavior but, on my HtmlEditControl I would like to test it myself to see if...
1
1813
by: Buddy Ackerman | last post by:
I don't know what the problem is. I have a form with several controls that need to be validated, I put a validation group in every form control, every validatoino control, the submit button and the validation summary control. I want it to do client side validation so I set every validation control display property to none and set the validation summary control to ShowMessage to true and ShowSummary to false. Als form controls set...
2
4508
by: dustbort | last post by:
I recently had a problem where my required field validator stopped working. But, the page still posted back and tried to insert a record into the database without performing server-side validation. I discovered that there was no aspnet_client folder in the root of my IIS Web site, and when I ran "aspnet_regiis -c", client-side validation was working again. However, what I don't understand is why the required field validator did not...
0
8345
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8857
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7368
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4181
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4348
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2763
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1754
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.