View previous topic :: View next topic |
Author |
Message |
Tobias
Joined: 03 Aug 2005 Posts: 1 Location: Sweden
|
Posted: Wed Aug 03, 2005 2:46 am Post subject: Validating to make shure they enter numbers |
|
|
Hi!
I have two inputs in a ASP page which should be answered with numbers. How do I validate to make shure they post the form with numbers? |
|
Back to top |
|
|
administrator Site Admin
Joined: 01 Oct 2004 Posts: 183
|
Posted: Wed Aug 03, 2005 7:21 am Post subject: |
|
|
You can use the RangeValidator ASP.NET control. The example below will ensure that the entry in the txtNumber field is an integer number between 1 and 93:
Code: |
<asp:TextBox id="txtNumber" runat="server"></asp:TextBox>
<asp:RangeValidator id="RangeValidator1" runat="server"
ControlToValidate="txtNumber" Type="Integer"
ErrorMessage="Enter integer number between 1 and 93"
MinimumValue="1" MaximumValue="93"></asp:RangeValidator>
|
_________________ Peter
ASP & ASP.NET Articles and Tutorials |
|
Back to top |
|
|
twinkle
Joined: 31 Jan 2006 Posts: 79
|
Posted: Tue Jan 31, 2006 9:24 pm Post subject: |
|
|
How about if you wanted to do something similar but wanted to limit it to proper date format? _________________ I shine |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2002 phpBB Group
|