I want to validate textbox on click of anchor with jquery required field valid开发者_开发问答ator http://docs.jquery.com/Plugins/Validation Can you let me know how can I do that?
Bind a event to the click of this anchor with this:
$("#field_id_you_want_to_validate").validate({
rules: {
required: true
}
})
Let say you have anchor with id "myAnchor". This is how i write the code
$("#myAnchor").click(function(){
// Validate the Textbox that you want
$("#textboxid").attr('class', 'required');
});
精彩评论