Re: javascript question...

by "Cyanide _7" <leo7278(at)hotmail.com>

 Date:  Wed, 21 Jun 2000 23:50:59 CDT
 To:  amusa(at)easeinternet.com
 Cc:  hwg-languages(at)hwg.org
  todo: View Thread, Original
not sure what you mean....something like this maybe?

<form name="f">
<select name="m">
<option value="10">ten</option>
<option value="20">twenty</option>
<option value="30">thirty</option>
<option value="40">fourty</option>
</select>
</form>

<Script>
function runTotal(){
  total += parseFloat(document.f.m[document.f.m.selectedIndex].value);
}
</script>

im not too sure you mean by "run a total", but the above script will add the 
select menus current value to the total. just a guess, try explaining 
exactly what your trying to do. - Cyanide_7

>
>Hello,
>
>I have a javascript question.  I am using the following code in a form to
>run a total.  If the form element "checkboxname" is checked then it adds 10
>to the total.
>
>         if (document.formname.checkboxname.checked) { total = total +
>     }
>
>Can some one give me an example of the code that would be used to run the
>total if a particular item were selected from a drop down box?  Thanks for
>your help
>
>G
>

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA