How To Deselect From Select Box in IE

Discussion in 'Javascript' started by Notorious, Jul 15, 2005.

  1. Notorious

    Notorious Guest

    The following Javascript line will deselect the currently selected
    index of a select box for Netscape and Firefox, but will not deselect
    in Explorer 6.

    theForm.assignedLic.options[aIndex].selected = false;

    Can anyone tell me what the workaround for IE is?

    Notorious, Jul 15, 2005
    1. Advertisements

  2. Notorious

    Matt Kruse Guest

    Is it a single-select, or a multi-select?

    In the case of a single select, you can set the selectedIndex to -1.
    Matt Kruse, Jul 15, 2005
    1. Advertisements

  3. Notorious

    Notorious Guest

    That did it. Thank you.
    Notorious, Jul 15, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.