Results 1 to 2 of 2

Thread: Clearing a SELECT box

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 1999
    Location
    Belfast
    Posts
    254
    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

  2. #2
    Addicted Member
    Join Date
    Jun 2000
    Location
    Pittsburgh, PA
    Posts
    149
    just set the options.length equal to zero.

    Code:
    document.form.select.options.length=0;
    form is the form name and select is the name of the select field.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width