close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Passing values from radio button

Thread began 1/12/2011 8:29 am by eyoung296270 | Last modified 1/24/2011 12:33 pm by Jason Byrnes | 2837 views | 15 replies |

eyoung296270

Passing values from radio button

I have set up a page with multiple add-on options (9). I have each add-on option to be selected via a radio button. I had to set up a recordset for each option and I have the first option in each add-on option as preselected so that if no upgrades are selected then the no upgrade option incremental value is passed along. I now want to also pass along the description field associated with that option so I added the description fields to the ecart object. The proper values are passed with the value column but the description field that is being passed is only associated with the first recordset for each option.
My question is: How do I get the right description to pass with the value for the radio button selected?

Sign in to reply to this post

Jason ByrnesWebAssist

In the cart object, you will need to create a column for the option.

Then in the add to cart button, select that column and set it to be update able from a text box.

Make note of the name of the text box that is added to the page, then delete it and replace it with the radio group.

Make sure to give the radio group the same name as the text box had.

Sign in to reply to this post

eyoung296270

I set up columns for the incremental value as well as the text value. I have radio buttons set up to be checked and by checking the radio button the incremental value is passed to the cart. All of that is working. The issue i am having is how to get the text value passed along as well.

Sign in to reply to this post

Jason ByrnesWebAssist

ahh, i see.

incremental prices are tricky this way, because you want to pass 2 pieces of information, price and description.

The only way to accomplish this is to use a database.
pricetable:
id - Primary Key
price - incremental price
description - item description


then set the radio buttons to pass the id value for the price description combonation, and use a lookup recordset to return the price and description for the selected radio button.

In the add to cart button, bind the price increment column to the price column from the recordset, and bind the description column to the description column from the recordset.

Sign in to reply to this post

eyoung296270

Thanks Jason. That is what I did and the price information is being passed as it should be. I'm having a problem getting the description value passed. As an example the increment valuse of the second record is passed but in all situations the text value that is being passed is to the first record. I guess I'm having a problem binding the text column to the same record. I have attached a copy of the page.

Attached Files
store-upgrade.zip
Sign in to reply to this post

Jason ByrnesWebAssist

your radio buttons are passing the pricce increment value.


read my last post again

you should have a table that has the price increment and description text in it.

the radio buttons should pass the ID that relates to the price increment / description combination in the database.

use a lookup recordset that looks up the ID value passed by the radio button, in the add to cart behavior, bind the price increment to the recordset price column and bind the description to the recordset description column.

it would help you to set up a simpler cart for testing to get familiar with the concept before jumping into the complex cart you have.

Sign in to reply to this post

eyoung296270

Thanks Jason. The cart that I want to show the text fields is actually on another page named cart.php. How would I go about doing a lookup recordset on another page? I'm used to having the statement perform Id=Id but there isn't anything that is passing the variable in the url when I am using a radio button. Or, do I put that variable on the button itself?

Sign in to reply to this post

Jason ByrnesWebAssist

you dont need to do the lookup on another page.


You need to set the radio buttons up to pass the id, and use the radio button value in the lookup recordset.


See the "Product Options with eCart" tutorial on the ecart support page, one part of it deals with product options that do not efect price, this is how you currently have it set up. the other part deals with product options that do effect price, this is section walks through having the option form element pass an id to a lookup recordset to get the option name and the price to pass back into the cart, this is how you need to have it set up.

Sign in to reply to this post

eyoung296270

I got the first set of radio buttons to work but I cannot get the second set to work. I have verified that the numbers and fields are correct. The second set is just like the first set but are not passing information.
Why?

Sign in to reply to this post

eyoung296270

here is a copy of my page.

Attached Files
store-upgrade.zip
Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...