Hi,
I need to reset all the values of elements in my form to empty string. But the problem is that the form can be reset but the variable still holding the value of y previous input.
For exp,
Input 5 value at first time.
Input 2 value at second time. The rest of the 3 field will take the input value I input previously.
Here my reset function:
function resetForm(formId)
{
var form, elements, elm;
if(document.getElementById)
form = document.getElementById(formId)
else
form = document.forms[formId];
form.reset();
elements = form.elements
/**
* Clear default text of text elements
*/
for( i=0, elm; elm=elements[i++]; )
{
if (elm.type == "text")
{
elm.value ='';
}
}
}
Help! :'(