| General Computing and Internet This is a discussion on, passing a variable to input type within the Community Forums forum; I want to pass the value of a drop down list to a hidden Input in my html code, something ... |
![]() |
![]() |
|
LinkBack | Thread Tools | ![]() |
|
|
#1 |
|
Join Date: Mar 2004
Location: Ibstock
Posts: 233
Thanks: 0
Thanked 0 Times in 0 Posts
|
passing a variable to input type
I want to pass the value of a drop down list to a hidden Input in my html code, something like...
Code:
<input type="hidden" name="quantity" value= list.value>
__________________
Pete Vickerstaff Freedom2Surf Pure Crap 512k/50:1 GW5
|
|
|
|
|
|
#2 |
|
Join Date: Mar 2004
Location: Ibstock
Posts: 233
Thanks: 0
Thanked 0 Times in 0 Posts
|
found the answer
so here it is....
bit of java first... Code:
<script language="JavaScript">
function setValue()
{
var form=window.document.steel;
var select=form.steel_seats;
form.quantity.value=select[select.selectedIndex].value;
}
</script>
Code:
<form target="paypal" name="steel" action="https://www.paypal.com/cgi-bin/webscr" method="post" onSubmit="setValue()">
<p align="left"><select size="1" name="steel_seats">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option>4</option>
<option value="5">5</option>
</select>
<input type="image" src="https://www.paypal.com/en_GB/i/btn/x-click-but22.gif" border="0" name="I4" alt="Make payments with PayPal - it's fast, free and secure!" width="94" height="21"></p>
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="quantity">
<input type="hidden" name="lc" value="GB">
</form>
Thanks to chessbott over at Tek-Tips forums for the answer.
__________________
Pete Vickerstaff Freedom2Surf Pure Crap 512k/50:1 GW5
|
|
|
|
![]() |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| change input TYPE="hidden" to input TYPE="text" | petevick | Webspace & Domain Names | 4 | 19-05-2004 08:36 PM |
All times are GMT. The time now is 06:33 AM.








