- Impact
- 49
I found this at SPF - http://www.sitepoint.com/forums/showthread.php?t=228732 - but I changed it around a little to support multiple input boxes.
Instead of using something such as;
in a textbox like...
and then when you click off and back on to edit something, it resets it again, you can use this function;
This way, you can use a textbox like this;
Instead of using something such as;
Code:
onclick="this.value=''"
in a textbox like...
Code:
<input type="text" name="email" value="Enter your email address" onclick="this.value=''" />
and then when you click off and back on to edit something, it resets it again, you can use this function;
Code:
<script language="Javascript">
<!--
function resetBox(box, defaultvalue) {
if (box.value == defaultvalue) {
box.value = "";
}
}
-->
</script>
This way, you can use a textbox like this;
Code:
<input type="text" name="email" value="enter your email" onfocus="resetBox(this, 'enter your email')" />















