[jQuery] Re: JQuery bigginer

2008-04-06 Thread thomas chen
$(document).ready(function(){ $('#dayOfBirth').bind('focus',function(){ $(this).val(''); }); }); - Original Message - From: "Raghu" <[EMAIL PROTECTED]> To: "jQuery (English)" Sent: Sat

[jQuery] Re: JQuery bigginer

2008-04-04 Thread thomas chen
$('#dayOfBirth').bind('focus',function(){ $(this).val(''); }); - Original Message - From: "Raghu" <[EMAIL PROTECTED]> To: "jQuery (English)" Sent: Saturday, April 05, 2008 12:55 AM Subject: [jQuery] JQuery bigginer > > Hi I am learning JQuery and Javascript so askin

[jQuery] Re: JQuery bigginer

2008-04-04 Thread Chuck
You want what is often called a PlaceHolder. Nice coverage of it in the "Learning jQuery" book by Chaffer and Swedberg. Basically you want to set a focus handler that notices if the value is your placeholder text (eg "Day") and sets the text value to "" in that case. It's nice if your blur handl

[jQuery] Re: JQuery bigginer

2008-04-04 Thread Andy Matthews
Something like this might workd (untested): // when the text field changes $('#myTextField').change(function(){ // if it's empty if ($(this).val() == '') { // give it focus $(this).focus(); } }; -Original Message- From: jquery-en