By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,449 Members | 972 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,449 IT Pros & Developers. It's quick & easy.

Deselect any selected items in a select form field with multiple attribute?

P: n/a
Hi,

I have two select fields with the multiple attribute so you can see all
options. When a user clicks on one form, I would like to deselect anything
from the other form. Is there a way to do this? eg
document.forms.form.list1.selectedIndex='NULL'; ?

Where can I find out about all options with regards to the DOM?

Thanks,

Keiron
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"Keiron Waites" <webmaster@-NOSPAM-sharemonkey.com> wrote in message
news:bn**********@hercules.btinternet.com...
Hi,

I have two select fields with the multiple attribute so you can see all
options. When a user clicks on one form, I would like to deselect anything
from the other form. Is there a way to do this? eg
document.forms.form.list1.selectedIndex='NULL'; ?

Where can I find out about all options with regards to the DOM?

Thanks,

Keiron


Ok I've answered my own question:

document.form.list1.selectedIndex='-1';

-1 means that nothing is selected in the select field. I hope this helps
someone.
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.