PDA

Click to See Complete Forum and Search --> : Clearing a SELECT box


lenin
Sep 30th, 2000, 02:48 PM
Hi,
is there any built in method to clear the contents of a select box using jscript? Do you have to iterate through every element in the list and use remove method?

New to subject.

Thanks

Lenin

jdavison
Oct 2nd, 2000, 12:26 PM
just set the options.length equal to zero.


document.form.select.options.length=0;


form is the form name and select is the name of the select field.