ZiaJet
11-11-2002, 10:56 PM
Hi to anyone out there who may have some knowledge about setting values from the result of a select in a selection list. I've written some test code in which the object is to set the value of a product description in an MGI (Modular Gateway Interface) tag with the result of a selected item in a selection list box. I've tried several things but none seem to yield the text value of the selection. Below is the test code:
<head>
<title>JS Test Page</title>
<!------- Begin JavaScript ----->
<script language="JavaScript">
function setVar() {
tvar = TSB.TSB.ProductSelection.optionSelected.text;
}
</script>
<!------- End JavaScript ----->
</head>
<mgitoken>
<body>
<form name="TSB" action="shoppingbasket.html" method="post">
<table border="1" width="100%">
<tr><!-- Row 1 -->
<td width="50%" align="center">
<p><mgiBuyMe productID="101003"
briefdescription="tvar"
price="19.95"
shippingCost="6.95"
quantitySize="3"><font face="Arial, Helvetica, sans-serif"><b>101003</b> Utensil
Holder 3" x 7" Ea. <b>$19.95</b></font></p></td><!-- Col 1 -->
<td width="50%" align="center">
<select name="ProductSelection" onChange="setvar()">
<option value="Prod1">Product 1</option>
<option value="Prod2">Product 2</option>
<option selected value="Prod3">Product 3</option>
</select>
</td><!-- Col 2 -->
</tr>
<tr><!-- Row 2 -->
<td colspan="2" valign="bottom" align="center">
<input src="buyme.jpg" type="image" height="30" border="0"> <input type="reset"> <input type="text" value=tvar ></td><!-- Col 1 -->
</tr>
</table>
</form>
</body>
</mgitoken>
It would be very helpful if somone could refer some example code.
I'm sure that I can't be the only one to ever want to try this.
Thanks in advance to anyone that responds. I'm sure your time is valuable and it is appreciated that you've taken the time to respond and help.
:)
Jean-Raul @ziapublishing
<head>
<title>JS Test Page</title>
<!------- Begin JavaScript ----->
<script language="JavaScript">
function setVar() {
tvar = TSB.TSB.ProductSelection.optionSelected.text;
}
</script>
<!------- End JavaScript ----->
</head>
<mgitoken>
<body>
<form name="TSB" action="shoppingbasket.html" method="post">
<table border="1" width="100%">
<tr><!-- Row 1 -->
<td width="50%" align="center">
<p><mgiBuyMe productID="101003"
briefdescription="tvar"
price="19.95"
shippingCost="6.95"
quantitySize="3"><font face="Arial, Helvetica, sans-serif"><b>101003</b> Utensil
Holder 3" x 7" Ea. <b>$19.95</b></font></p></td><!-- Col 1 -->
<td width="50%" align="center">
<select name="ProductSelection" onChange="setvar()">
<option value="Prod1">Product 1</option>
<option value="Prod2">Product 2</option>
<option selected value="Prod3">Product 3</option>
</select>
</td><!-- Col 2 -->
</tr>
<tr><!-- Row 2 -->
<td colspan="2" valign="bottom" align="center">
<input src="buyme.jpg" type="image" height="30" border="0"> <input type="reset"> <input type="text" value=tvar ></td><!-- Col 1 -->
</tr>
</table>
</form>
</body>
</mgitoken>
It would be very helpful if somone could refer some example code.
I'm sure that I can't be the only one to ever want to try this.
Thanks in advance to anyone that responds. I'm sure your time is valuable and it is appreciated that you've taken the time to respond and help.
:)
Jean-Raul @ziapublishing