Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1550 How to determine whether the user has already selected an option from a multi select list?

You are here: irt.org | FAQ | JavaScript | Form | Q1550 [ previous next ]

Either make the first item a dummy one "Please select" and use:

<script language="JavaScript"><!--
if (document.myForm.mySelect.selectedIndex < 0) someThingSelected=true
//--></script>

Or you need to loop through all the entries:

<script language="JavaScript"><!--
if (document.myForm.mySelect.selectedIndex < 0) {
   morethanone = false;
   for (i=document.myForm.mySelect.selectedIndex;i

©2018 Martin Webb