This is a migrated thread and some comments may be shown as answers.

[Solved] using with jquery validation problems

1 Answer 139 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
minkbear
Top achievements
Rank 1
minkbear asked on 09 May 2012, 04:53 AM
I tried to use jquery.validation with NumericTextBox by setting code shown below:

$.validator.addMethod("ftvalidate", function(value, element) {
                var currentId = $(element).attr('id');
                var splitcurrentId = currentId.split("_");
         
                return false;
            }, '*');
     
            $("#MyForm").validate({
                debug: true,
                submitHandler: function (form) {
                    form.submit();
                },
                rules: {
                       NumericTextBox1 : "ftvalidate",
                    TextBox1 : "ftvalidate"
                },
            });

NumericTextBox1  is NumericTextBox.
TextBox1 is simple textbox.

So the validation work well with TextBox1 only but not work with NumericTextBox1.
I tried to change from "NumericTextBox1" to "NumericTextBox1-input-text"
And from "NumbericTextBox1" to "NumericTextBox1-input", Both are not work.

Please advice. Thank you much.

P.S. using
jquery 1.4.4
jquery.validation 1.9
telerik 2010.3.1110.235

1 Answer, 1 is accepted

Sort by
0
minkbear
Top achievements
Rank 1
answered on 09 May 2012, 04:02 PM
[updated] If using 'NumericTextBox1-text' is work well.
Jquery.Validation using name not id.
Tags
NumericTextBox
Asked by
minkbear
Top achievements
Rank 1
Answers by
minkbear
Top achievements
Rank 1
Share this question
or