Created
April 2, 2014 18:20
-
-
Save ArupSen/9939996 to your computer and use it in GitHub Desktop.
Add default text to form field. Text removed when field is focused but repopulated if nothing is entered and it loses focus.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function recall(thisfield, defaulttext) { | |
if (thisfield.value == "") { | |
thisfield.value = defaulttext; | |
} | |
} | |
// the following goes in the text input line | |
// onfocus="this.value= '';" onblur="recall(this,'Your email address');" | |
// change 'Your email address' to any default text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment