Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > RangeValidator not checking the RANGE?

Reply
Thread Tools

RangeValidator not checking the RANGE?

 
 
D. Shane Fowlkes
Guest
Posts: n/a
 
      02-09-2004
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>



 
Reply With Quote
 
 
 
 
Joe Gass
Guest
Posts: n/a
 
      02-09-2004
you need
"D. Shane Fowlkes" <> wrote in message
news:%...
> 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">


 
Reply With Quote
 
 
 
 
D. Shane Fowlkes
Guest
Posts: n/a
 
      02-09-2004
D'oh! Thanks.


"Joe Gass" <> wrote in message
news:...
> you need
> "D. Shane Fowlkes" <> wrote in message
> news:%...
> > 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">
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RangeValidator control causing buttons to not work deast_98@yahoo.com ASP .Net 1 05-09-2006 08:52 AM
CompareValidator not working where a RangeValidator is hooterbite@yahoo.com ASP .Net 3 03-29-2005 05:19 PM
Help: RangeValidator Not Working! Lucas Tam ASP .Net 2 01-31-2005 04:09 PM
RangeValidator Minimum Date can not be 01.01.0001 Johannes Hammersen ASP .Net 2 11-23-2004 12:55 PM
RangeValidator - not working when user enters a space =?Utf-8?B?dGNi?= ASP .Net 1 04-27-2004 04:58 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57