Forum Moderators: open

Message Too Old, No Replies

Options With Values & Names?

Html/AJAX/Javascript

         

Kings on steeds

12:38 pm on Oct 3, 2006 (gmt 0)

10+ Year Member



Ok, well i am making a website with a form that sends data to paypal, what i want is a text box for price... depending on which select option is picked... an example...

<select name="myoptions">
<option value="item1" name="$10">Cd1 </option>
<oprion value="item2" name="$12">Cd2 </option>
</select>

and the when i do my post the $myoptions would read "item1"/"item2", the <input type="text" name="Amount" /> would read $10/$12... can this be done?

this.options[this.selectedIndex].name)..? maybe... can anyone advise?

Thanks

Fotiman

2:48 pm on Oct 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You really don't want to do this with JavaScript. What you want is something to process this server side, otherwise you will have problems with users who disable JavaScript (it's not reliable) and possibly people who hack your javascript to change the amounts that get posted.