|
|
|
|
![]() ![]() |
Feb 24 2007, 05:10 PM
Post
#1
|
|
|
Premium Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 179 Joined: 21-October 06 From: Pennsylvania, USA Member No.: 32,028 |
Hey,
Let me try to do my best to explain this... I have a business website that specializes in building custom computers. Customers can use our online form to select components for their computer from various categories (Hard drive size, processor, memory, ect..) Take a look at the page here: www.plugcomputers.com/amdschedule.php As you can see there are many radio buttons with different computer part choices. I wanted to add some way to assign a dollar value to each different part, so the customer knows how much its costing them with each upgrade. If you scroll to the bottom of the page you will see some red text, I want that price to reflect the sum off all the choices they made above. Adding up all the different upgrade dollar amounts so that they have an idea how much their computer will be while selecting components. The current red number at the bottom is the base price with all the default selected values. For example, in the first category "Processor" The base price includes the AMD x2 3800+, If i wanted the upgrade price for the next option (the AMD x2 4400+) to be +$50 how can I get that into the form so when the user clicks that radio the price at the bottom automatically adds $50? Thank you and I appreciate any help... |
|
|
|
Feb 24 2007, 09:08 PM
Post
#2
|
|
|
A computer once beat me at chess, but it was no match for me at kick boxing. ![]() Group: [MODERATOR] Posts: 3,994 Joined: 24-July 05 From: In Trouble Again... still? Member No.: 9,787 ![]() |
I don't have enough knowledge to apply the effect to your form, but I think the approach you need to take, if you want a dynamic, local update of the page total without a call to the server for updating prices is to use some javascript to do that.
Perhaps the "onchange" event is the secret? Here is a snippet I use for temperature conversions between Celsius and Fahrenheit. I cut and pasted the code, so really can't explain the details, but it tells the form to update the 'other' temperature if you change one value. And it doesn't use checkboxes, so that is where I get lost. CODE <form> F: <input type="text" name="F" value="32" onChange="C.value = 100/(212-32) * (this.value - 32 )"> C: <input type="text" name="C" value="0" onChange="F.value = (212-32)/100 * this.value + 32 "></font> </form> Just wondering if this Topic should be moved to the javascript Topics? Use the Reprt feature to request that it be moved, if you think your solution is better found over there. Thanks. |
|
|
|
Feb 24 2007, 09:31 PM
Post
#3
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 293 Joined: 27-January 07 From: Winter is cold here. Member No.: 37,984 ![]() |
Just wondering if this Topic should be moved to the javascript Topics? Use the Reprt feature to request that it be moved, if you think your solution is better found over there. Thanks. It's a HTML attribute, actually. The form Element is using HTML to submit the form contents to the server. The Javascript Part of this is what get sent to the server. That's what I THINK. I'm Not sure, but ok. ~Imtay22 |
|
|
|
Feb 24 2007, 09:40 PM
Post
#4
|
|
|
A computer once beat me at chess, but it was no match for me at kick boxing. ![]() Group: [MODERATOR] Posts: 3,994 Joined: 24-July 05 From: In Trouble Again... still? Member No.: 9,787 ![]() |
Judging by this :
QUOTE so the customer knows how much its costing them with each upgrade. If you scroll to the bottom of the page you will see some red text, I want that price to reflect the sum off all the choices they made above. Adding up all the different upgrade dollar amounts so that they have an idea how much their computer will be while selecting components. I get the impression they want the upgraded amount without a server call. That would need js. |
|
|
|
Feb 25 2007, 09:44 PM
Post
#5
|
|
|
Premium Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 179 Joined: 21-October 06 From: Pennsylvania, USA Member No.: 32,028 |
Right jlhaslip, we don't need this dollar value to be saved anywhere or anything. I just want it to be visible at the time of selection so they know what price range their selections are putting them in.
Any idea how to do this with JS or whatever is needed? |
|
|
|
Feb 25 2007, 09:50 PM
Post
#6
|
|
|
A computer once beat me at chess, but it was no match for me at kick boxing. ![]() Group: [MODERATOR] Posts: 3,994 Joined: 24-July 05 From: In Trouble Again... still? Member No.: 9,787 ![]() |
No, but I will move it to the javascript sub-forum.
|
|
|
|
Feb 27 2007, 01:20 AM
Post
#7
|
|
|
Premium Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 179 Joined: 21-October 06 From: Pennsylvania, USA Member No.: 32,028 |
Thanks jlhaslip.
So anyone know any javascript and willing to help out a fellow forum member? haha. I know this probably isn't the easiest coding, but if you give me an example I'll probably be able to figure it out. |
|
|
|
![]() ![]() |
Similar Topics
|