I use this code to reset my radio buttons, but it doesn't reset my text fields. How can I make it reset my text fields?
function rensa(obj)
{
for(var i=0; i<obj.length; i++)
obj[i].checked = false;
}
I use this code to reset my radio buttons, but it doesn't reset my text fields. How can I make it reset my text fields?
function rensa(obj)
{
for(var i=0; i<obj.length; i++)
obj[i].checked = false;
}
Why don't you just use reset()
, e.g.:
document.myform.reset();
function rensa(obj)
{
for(var i=0; i<obj.length; i++){
obj[i].checked = false;
obj[i].value = "";
}
}