RangeValidator not checking the RANGE?

  • Thread starter D. Shane Fowlkes
  • Start date
D

D. Shane Fowlkes

This seems simple enough but why can't I get it to check the input BETWEEN
the two ranges I specify? If I set the Min value to 1 and the Max to 10, it
will ONLY validate 1 OR 10....not 2 thru 9. Weird? I must be doing
something wrong.

TIA.

My test page:

http://www.drumpub.com/test.aspx


My code:

<form runat="server">
<asp:TextBox ID="txtQuantity" runat="server" MaxLength="5" Columns="5" />
<asp:RangeValidator ControlToValidate="txtQuantity" id="QuantityValidator"
runat="server" Font-Bold="true" Font-Size="10" MinimumValue="1"
MaximumValue="10">*Quantity must be between 1 and 10.</asp:RangeValidator>
<asp:Button ID="btnSubmit" runat="server" Text="I'm Done. Submit It." />
</form>
 
J

Joe Gass

you need
D. Shane Fowlkes said:
This seems simple enough but why can't I get it to check the input BETWEEN
the two ranges I specify? If I set the Min value to 1 and the Max to 10, it
will ONLY validate 1 OR 10....not 2 thru 9. Weird? I must be doing
something wrong.

TIA.

My test page:

http://www.drumpub.com/test.aspx


My code:

<form runat="server">
<asp:TextBox ID="txtQuantity" runat="server" MaxLength="5" Columns="5" />
<asp:RangeValidator ControlToValidate="txtQuantity" id="QuantityValidator"
runat="server" Font-Bold="true" Font-Size="10" MinimumValue="1"
MaximumValue="10">*Quantity must be between 1 and 10.</asp:RangeValidator>
<asp:Button ID="btnSubmit" runat="server" Text="I'm Done. Submit It." />
</form>
you need to specify Type="Integer"

e.g.
<asp:RangeValidator ControlToValidate="txtQuantity" id="QuantityValidator"
Type="Integer"
runat="server" Font-Bold="true" Font-Size="10" MinimumValue="1"
MaximumValue="10">
 
D

D. Shane Fowlkes

D'oh! Thanks.


Joe Gass said:
you need
10,
you need to specify Type="Integer"

e.g.
<asp:RangeValidator ControlToValidate="txtQuantity" id="QuantityValidator"
Type="Integer"
runat="server" Font-Bold="true" Font-Size="10" MinimumValue="1"
MaximumValue="10">
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top