this is what I have
function showValues(theForm) {
currVal = document.getElementById("ptotal");
sum = 0;
for(i=0;i<theForm.elements.length - 1;i++) {
sum += parseInt(theForm.elements[i].value);
}
alert(sum);
}
Unfortunately the radios have a value of 0 and a value of 1.
So this adds up 0 + 1 per radio and returns 1.
How do I make it add up only whats selected, not both values?
Maybe a radio isnt the right way of doing this? I'm open to any suggestions.
On Tue, 31 Aug 2004 12:27:23 -0400, joe velez
<[EMAIL PROTECTED]> wrote:
> If you want the price displayed on the page and updated every time a new option is selected w/o the page being reloaded you need to use _javascript_, otherwise i would imagine the radio button's value would be associated with a price from the database. (optionid "12" = "$50")
>
>
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
[Donations and Support]
- SOT : Keeping JS Count Greg Morphis
- Re: SOT : Keeping JS Count Greg Morphis
- Re: SOT : Keeping JS Count Greg Morphis
- RE: SOT : Keeping JS Count d.a.collie
- Re: SOT : Keeping JS Count joe velez
- RE: SOT : Keeping JS Count Greg Morphis
- RE: SOT : Keeping JS Count d.a.collie
- Re: SOT : Keeping JS Count Greg Morphis
- RE: SOT : Keeping JS Count Pascal Peters
- RE: SOT : Keeping JS Count Dave Watts