onblur deletes data when submit, why?

Posted by Syom on Stack Overflow See other posts from Stack Overflow or by Syom
Published on 2010-03-28T18:28:12Z Indexed on 2010/03/28 18:33 UTC
Read the original article Hit count: 217

Filed under:
|

i have the following script


<input style="color: #ccc" type="text" value="something" name="country"  
onFocus="if (this.value == 'something') {
    this.value='';this.style.color='black';}" 
onblur="if (this.value != 'something') {
    this.value='something'}" />
<input  type="submit" value="save"  />

it works fine, but when i click on submit button, it also deletes the value "something" so, what can i do, if i want, that when i click on submit button, value doesn't delete? thanks

© Stack Overflow or respective owner

Related posts about html

Related posts about JavaScript