views:

33

answers:

1

Hello all.

I have come unstuck with a simple compare validation.

I have the following code

<asp:TextBox ID="tbxHowMany" runat="server" 
            style="z-index: 1; left: 310px; top: 385px; position: absolute; text-align: center;" 
            Width="75px"></asp:TextBox>

       <asp:CompareValidator ID="CompareValidator1" runat="server" 
                ErrorMessage="please select less than 200 products" 
                ControlToValidate="tbxHowMany" Font-Names="Trebuchet MS" Font-Size="12px" 
                Operator="LessThanEqual" 
                style="z-index: 1; left: 285px; top: 425px; position: absolute; height: 40px; width: 140px; text-align: center" 
                ValueToCompare="200" SetFocusOnError="True"></asp:CompareValidator>

So when a user enters a figure higher than 200, the validation appears.

However, when I change this figure to say, 30, the validation remains. I must be doing something really stupid, I just don't know what!

UPDATE: I have also just noticed that this validation occurs when a number greater than '20' is entered into the checkbox. I'm not very confused. I am assuming this is a type issue?

If someone can say "You're a tool Mr Dean, you need to do this..." I would be extremely grateful.

A: 

Sorted by changing display to dynamic and type to integar.

Thank you to whoever posted then quickly removed it.

MrDean
I think it was you Skaffman..thank you!!!!
MrDean