I've got a jQuery script I use for hiding/showing default values in small forms:
The issue is that I need to use this script on multiple fields (with the same CSS class) within the same form. What syntax changes need to be made? Right now -- this script will work for the first field you click in -- but won't work for the other fields in the same form.Code:$("#contactForm .textField").focus(function() { if (!default_values[this.id]) { default_values[this.id] = this.value; } if (this.value == default_values[this.id]) { this.value = ''; } $(this).blur(function() { if (this.value == '') { this.value = default_values[this.id]; } }); });
Thank you for your help.


Reply With Quote
Bookmarks