validate

using jquery.validate  
what would be the syntax to validate just one field within a form?

keep in mind that the one field is within a form and the entire form is also validated.
but this is a different function where an element is clicked and the field in question is validated on being blank or not.
thanks
LVL 25
dgrafxAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Gurvinder Pal SinghConnect With a Mentor Commented:
below is the sample of how to capture the onclick event on an element and check if another field is empty
$("#elementId").bind("click", function(){
   var value = $("#anotherElementId").val();
   if ( value.length == 0  )
   {
      alert("field is empty");
      $("#anotherElementId").focus();
   }
});

0
 
Gurvinder Pal SinghCommented:
you just have to capture the onclick event of the element and do the validation.

Where are you struck?
0
 
dgrafxAuthor Commented:
where am i stuck?
start with syntax ...
0
 
dgrafxAuthor Commented:
yeah ok - i'll just use something like that.

to explain: i'm working on a project where the owner wants EVERYTHING to be jquery.
ya know - the latest buzz words and catch phrases ...
so some of my really simple questions are really saying "how do you do this using jquery"

thanks a lot
0
 
Gurvinder Pal SinghCommented:
Its Ok, hurl in your questions :)

Thanks for the points
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.