mj.redfox...@gmail.com wrote:
Hi,
Could anyone tell me why this...
document.forms[0].elements[i].value=null;
...appears to be assigning the actual string value of "null" to my form
element, rather than actually nullifying it?
Because all form element values are stored as strings and any value
will be converted to string before being assigned. And string
representation of null is "null".
To clear an element value set it to empty string:
document.forms[0].elements[i].value="";