tags:

views:

20

answers:

2

When the page loads the textbox is showing default to State and when clicked on textbox it is showing empty like how it is supposed to work in this code. But when i do not enter anything into that textbox and move to next textbox i want it show State again. How can i do this?

<input type="textbox" id="state" border="0"  value="State" class="form_textbox4" onFocus="if
(this.value==this.defaultValue) this.value=''; ">
+1  A: 
onblur="if (this.value=='') this.value=this.defaultValue;"
Sam Dufel
A: 

Like so:

<input type="textbox" id="state" border="0"  value="State" class="form_textbox4" onFocus="if
(this.value==this.defaultValue) this.value=''; " onBlur="if(this.value=='') this.value=this.defaultValue;">
Daniel Mendel