Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help - PHP text from option in select menu!

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
have a page with a number of select menus, of different parts of a computer. A user can select the different parts, i set the value to the price of each part and use javascript to eval the total price.
I then use php to send the information to a retailer.
But php gets the value information, which is the price,
i dont want to have to code it so that it changes price to the text, i want to access the text of the selected option with php then pass that along.
Anyone? Help ME? Thanks
 
code is always useful in situations like this..... ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
you have to put in the values the text or the id, and then you have to build an array in JS with the prices. Look, the indexes in the select and in the array, should be the same for simplicity.

Then, you calculate the price based on the array and not in the value of the select. When you submit the information, PHP will get the text or the id as you placed in the value.

Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top