----- Original Message -----
From: "Steve Miller"

> but does it work for a multiple selection pulldown?
> There is only one name - recipient[] - but it can have
> several values. So, if my select box name is
> form.elements['recipient[]', how do I tell if at least
> one of the selections is selected?

if s = form.elements['recipient[]'] then s.length contains the number of
options in the select.  The first option will be s.options[0]...    if
s.options[0].selected then it got selected :-)

...and, OK, here's a script -- if your form contains

<select name="likes[]" size="4" multiple>
<option value=1>Chocolate
<option value=2>Fruit
<option value=3>Fast foods
<option value=4>Healthy foods
</select>

...then you need...

  lk = boxform.elements['likes[]'];
  l = lk.length;
  msg = '';
  for (i=0; i<l; i++)
    if (lk.options[i].selected) msg += 'Picked option ' +
      lk.options[i].value + '\n';
  if (msg == '') msg = 'No likes were selected';
  alert(msg);



____ � The WDVL Discussion List from WDVL.COM � ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] 
       Send Your Posts To: [EMAIL PROTECTED]
To set a personal password send an email to [EMAIL PROTECTED] with the words: "set 
WDVLTALK pw=yourpassword" in the body of the email.
To change subscription settings to the wdvltalk digest version:
    http://wdvl.internet.com/WDVL/Forum/#sub

________________  http://www.wdvl.com  _______________________

You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to