3

i am using javascript validation library file for validating textbox values. now i want to allow user to enter only value in between 0 and 9999999.99 . how to do this by using

$.validator.addMethod
?

2 Answers 2

2

Why don't you just use ASP.NET Validators?

<asp:RangeValidator ID="rValidator" runat="server" 
        ControlToValidate="thatControl"
        MaximumValue="9999999.99"
        MinimumValue="0" 
        Type="Double" />
Sign up to request clarification or add additional context in comments.

1 Comment

RangeValidators only display an error message :( I need to constrain the values displayed.
1

You can better use jQuery for this, makes it easier (plug and play).

Check out this sample http://docs.jquery.com/Plugins/Validation/Methods/max

2 Comments

hey thanx for this link,its helpful.but along with this i want min value grater than 0(e.g. 0.70) and i want to validate this for currency(decimal data type) .
docs.jquery.com/Plugins/Validation/Methods/rangelength#range for range, for the decimal you should play with the code a bit. You can always cast you decimal to int and set 100 as you max

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.