Hi,
A bit stuck here. I have a form and instead of having labels beside each input box i have the default value set as the label. When the user clicks on it the default value is removed. I do this like so:
[HTML]<input name="name" type="text" value="Name: " onfocus="if(!th is._haschanged) {this.value=''} ; this._haschange d = true;"/>[/HTML]
But now when i hit the reset button and the form values are reset but i can't seem to find a way to reset all the _haschanged values back to false.
This is my reset code:
Any ideas what i'm doing wrong here. Thanks.
B
A bit stuck here. I have a form and instead of having labels beside each input box i have the default value set as the label. When the user clicks on it the default value is removed. I do this like so:
[HTML]<input name="name" type="text" value="Name: " onfocus="if(!th is._haschanged) {this.value=''} ; this._haschange d = true;"/>[/HTML]
But now when i hit the reset button and the form values are reset but i can't seem to find a way to reset all the _haschanged values back to false.
This is my reset code:
Code:
<a class="link" href="#J1" onclick="
var myform=document.getElementById('form')
if (myform){
var mylist = myform.getElementByTagName('input');
if (mylist) {
for (var i=0; i<mylist.lenght; i++) {
mylist[i]._haschanged=false;
}
}
}
myform.reset();
">reset</a>
B
Comment