Jump to content

Recommended Posts

Dear all

I have a simple php page which has about 5 products on it, 3 of the products are the same price and 2 of the products are the same price, I have a radio button next to each product and the value of the radio button is the price of the product, so for example 9.99

I store this in a sql database, what I want to do is to pass another value with whatever radio button they select, this will be stored in the sql database and be able to tell me what the item code is.

For example

I have a radio button which is 9.99 and the item code is 3454334
I then have another radio button which is 9.99 and the item code is 1124565

Is there a way to pass a hidden value with a selected radio button? There would need to be a hidden field for each product, so I could pass the price and also the item code.

I was thinking about maybe an if statement, but as some of the radio button products values are the same price, im not going to be able to connect a if statement to the price of each product, if you see what I mean.

Has anyone been able to do this?

Any help would be great.

Thanks

Ed
Link to comment
https://forums.phpfreaks.com/topic/4915-two-values-to-one-radio-button/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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.