Jump to content
xisto Community
Sign in to follow this  
PlugComputers

Help With Assigning Values To Form Options?

Recommended Posts

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: http://forums.xisto.com/no_longer_exists/ 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...

Share this post


Link to post
Share on other sites

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.

<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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Judging by this :

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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.