Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Help With Assigning Values To Form Options?
PlugComputers
post 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...
Go to the top of the page
 
+Quote Post
jlhaslip
post 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 Icon

Group: [MODERATOR]
Posts: 3,994
Joined: 24-July 05
From: In Trouble Again... still?
Member No.: 9,787
Spam Patrol



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:&nbsp;&nbsp;
<input type="text" name="F" value="32" onChange="C.value = 100/(212-32) * (this.value - 32 )">

&nbsp;&nbsp;&nbsp;&nbsp;C:&nbsp;&nbsp;
<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.
Go to the top of the page
 
+Quote Post
Imtay22
post 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
Spam Patrol



QUOTE(jlhaslip @ Feb 24 2007, 04:08 PM) *
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
Go to the top of the page
 
+Quote Post
jlhaslip
post 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 Icon

Group: [MODERATOR]
Posts: 3,994
Joined: 24-July 05
From: In Trouble Again... still?
Member No.: 9,787
Spam Patrol



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.
Go to the top of the page
 
+Quote Post
PlugComputers
post 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?
Go to the top of the page
 
+Quote Post
jlhaslip
post 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 Icon

Group: [MODERATOR]
Posts: 3,994
Joined: 24-July 05
From: In Trouble Again... still?
Member No.: 9,787
Spam Patrol



No, but I will move it to the javascript sub-forum.
Go to the top of the page
 
+Quote Post
PlugComputers
post 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.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Free Windowsxp Sp2 Cd From Microsoft(12)
  2. *** Click Here To Get Your Free Hosting ***(1)
  3. Form To Php Mail. Attachment(14)
  4. Loop Through Form(8)
  5. How To Make A Search Form And Php Code?(10)
  6. Have Diferences Of Performance Form Ps2 Full Console To Mini-ps2?(8)
  7. Are You A Gamer? How Are You Weight Wise?(39)
  8. Problem With Java Script Popup Form(1)
  9. What Is A Computer Form Factor(1)
  10. Php Ftp Upload Form(1)
  11. Controlling Differents Keypresses In A Single Form(0)
  12. I Liked This Form Builder(4)
  13. Updating Php File Through A Web Form(5)
  14. Brand New Motherboard Form Factor Coming Out?(2)
  15. Domain Constants --- A, Mx, Ns & Cname Values(2)
  1. Form Not Returning Correct Email Address(5)
  2. How To Make Form Nested In Internet Explorer ?(2)
  3. Html Form!(4)
  4. Registration Form?!(6)
  5. Help With Form Actions.(1)
  6. Gahhh This Isn't Going Well Please Help!(12)
  7. Cameraphones... Which Is Best?(18)
  8. Application Form [approved](2)
  9. Vb 2008 Linking To Another Form..(0)
  10. Perl For Automated Web Form Search(1)
  11. Design A Contact Form In Flex Part 1(0)
  12. Text Size In "fill-in" Form Blanks(2)
  13. About Posting Form(2)


 



-