JavaScript Clear Form Field "Value"

 

 

This script will clear the preset values of a form field.

 

 

Example

 

Script Source

 

<The Form >

<form name="myForm" action="">
<input name="clear_value" onfocus="clear_field()" value=" Try it! Click Here " />
<Input type="submit" value="Send it! (Disabled)" />
<input type=reset>
</form>

 

<The JavaScript >

<script type="text/javascript">
<!-- Hide from old browsers
function clear_field()
{
if (document.myForm.clear_value.value == " Try it! Click Here ")
document.myForm.clear_value.value = "";
}
//-->
</script>

 

Please let me know if this script was helpful to you.

[rating]

 

Prose from the Pros

Only prefer renowned wireless internet service providers while looking for business wifi services for your company website. Because, only reputable companies provide full wireless internet coverage that a successful business requires. There are many different types of wireless i.e. cingular wireless but java based web businesses usually go well with sprint wireless that have special java toolkit.