2

I ve placed a small validation in a javascript function . Now i need to call jquery validation from javascript function .. how can i call the jquery validation from javascript ???

2
  • Er, just call it like any other function? Commented Apr 26, 2011 at 5:58
  • can u give me with an example .. Commented Apr 26, 2011 at 6:00

2 Answers 2

1

From the jquery tutorial site

you can do:

$("input[type='text']").change( function() {
    // check input ($(this).val()) for validity here
});

if you want to validate text inputs

Sign up to request clarification or add additional context in comments.

1 Comment

I am using Labelify and Validate plugins of JQuery. Error messages displayed for invalid data are Title field of text boxes. I want to use the custom messages? while not affecting the title message
1

You need to call the form() method of the validation plugin

var valid = $('form').validate().form()

3 Comments

function clickFunc() {for ( var i = 1; i <= divLength; i++) { var productGroupId = document.getElementById("productGroupId"+i+"").value; if(productGroupId ==1){ document.getElementById('message').innerHTML = "Please select Product Group"; return false; } } // this s a function. hw can i call jquery validation from this ..
and why call an additional jquery validation function if you already have your own validation?? The normal way would be to write a jquery validation validator (e.g. you function) and then invoke the validation of the entire form the jquery validation plugin.
actually i ve invoked a value 1 for the function so jquery wont validate t .. but for the remaininig column i ve jquery validation...

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.