nyar

02-05-2004, 09:57 AM

Howdy,

I've got a form with many dropdown boxes - what needs to happen is people select things in the dropdown boxes and a number is calculated at the bottom. Each dropdown box might have something like:

Type of user: * Newbie (1 point)

* Regular (5 points)

* Addict (10 points)

Donation: * $0-$5 (add 10 points)

* $5-$10 (add 20 points)

* $10-$20 (add 25 points)

Time on forum: * 1 week (multiply by 1)

* 1 month (multiply by 2)

* 6 months (multiply by 3)

* 1 year (multiply by 4)

At the bottom of the form there is a "Calculate" button, and a textarea called "total points". What I want to happen is for a number to be calculated when they click on the button, depending on what was chosen in the dropdown box - and the total value comes up in the textarea.

(If it's possible, the button doesn't even need to be there - maybe anytime something is selected in the dropdown box, the total is automatically calculated?)

I'm not sure how I calculate this, or give each dropdown box entry its own value. I realize I can do this in PHP, but it's important that it all happens on the one page.

Thanks!

I've got a form with many dropdown boxes - what needs to happen is people select things in the dropdown boxes and a number is calculated at the bottom. Each dropdown box might have something like:

Type of user: * Newbie (1 point)

* Regular (5 points)

* Addict (10 points)

Donation: * $0-$5 (add 10 points)

* $5-$10 (add 20 points)

* $10-$20 (add 25 points)

Time on forum: * 1 week (multiply by 1)

* 1 month (multiply by 2)

* 6 months (multiply by 3)

* 1 year (multiply by 4)

At the bottom of the form there is a "Calculate" button, and a textarea called "total points". What I want to happen is for a number to be calculated when they click on the button, depending on what was chosen in the dropdown box - and the total value comes up in the textarea.

(If it's possible, the button doesn't even need to be there - maybe anytime something is selected in the dropdown box, the total is automatically calculated?)

I'm not sure how I calculate this, or give each dropdown box entry its own value. I realize I can do this in PHP, but it's important that it all happens on the one page.

Thanks!