...

View Full Version : How do I clear a drop down box.



Srikanth.S
06-01-2005, 06:52 AM
Hi,
I'm using several drop down boxes in my site and to clear my values in that i'm using a function.The drop down boxes are clearing well in IE and Opera but not in Firefox and mozilla.Tell me how to clear the values in my drop down boxes.
The code I'm using in my function is
d.everyHour.value = "";.

Kor
06-01-2005, 10:39 AM
try
document.forms['formname'].elements['boxname'].value

but in facy you need to select the first option (I guess that the first option has the value ='' or no value, as the select's value is always the selected option's value.

so that try rather:
document.forms['formname'].elements['boxname'].options[0].selected=true;



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum