We Recommend

Pro JavaScript Techniques Pro JavaScript Techniques
Pro JavaScript Techniques is the ultimate JavaScript book for the modern web developer. It provides everything you need to know about modern JavaScript, and shows what JavaScript can do for your web sites. This book doesn't waste any time looking at things you already know, like basic syntax and structures.


Posted By

TC on 09/12/06


Tagged

form jquery


Versions (?)


Who likes this?

6 people have marked this snippet as a favorite

penguin999
francisre
neuroasis
vali29
orhanveli
mikegreen


Use jQuery to validate form text


Published in: JavaScript 


URL: http://beta.plazes.com/register/

Found on the jquery mailing list: http://jquery.com/discuss/2006-April/004625/ The url shows it in action, checking text when you move away from a field.

  1. $("#my-form input[@type='text']").blur(function() {
  2. var query = {};
  3. query[this.name] = this.value;
  4. $.post("/path/to/your/validation.php", query, function(response) {
  5. // do something like changing a css class, disable submit...
  6. )};
  7. });

Report this snippet 

You need to login to post a comment.