Created
November 26, 2011 23:25
-
-
Save earlonrails/1396494 to your computer and use it in GitHub Desktop.
Clear Field on Focus and restore if nothing entered javascript and html input.
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 autoUnput(thefield, orig){ | |
if(orig){ | |
if(thefield.value == ''){ | |
thefield.value = orig; | |
} | |
} else if (thefield.defaultValue==thefield.value){ | |
thefield.value = ""; | |
} | |
} |
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
<input type="text" onfocus="autoUnput(this)" onblur="autoUnput(this, 'Email')" value="Email" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment