I can't seem to get this to work without hard coding the form name. I will be processing multiple forms on the page and I need to be able to change the amount field on a specific form on the page. Any other suggestions?
<html>
<head>
<title>Small Robe Orders</title>
<script LANGUAGE="JavaScript1.1">
function ChangeAmount(theForm){
document.theForm.amount.value="12.00";
}
</script>
</head>
<body>
<table width="600" height="400" bgcolor="#F8bf24" cellspacing="2" cellpadding="2" bordercolor="#0000ff" border="2" >
<th align="center"colspan="2">Kia's Kaps </th>
<tr><!-- Row 1 -->
<td align="center"><img src="../PinkPatriot.jpg" width="150" height="142" alt="" border="0">
<form name="form1" target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="text" name="amount" value="0.00">
<input type="hidden" name="cn" value="Comments or Questions?">
<table>
<tr>
<td><input type="hidden" name="on0" value="Size">Size</td>
<td><select name="os0" onChange=ChangeAmount(this.form)>
<option value="Small">Small
<option value="Medium">Medium
<option value="Large ">Large
<option value="X Large">X Large
<option value="XX Large">XX Large</select>
</td></tr></table>
<input type="image" src="https://www.paypal.com/images/sc-but-03.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="add" value="1">
</form><br>
</body>
</html>
<html>
<head>
<title>Small Robe Orders</title>
<script LANGUAGE="JavaScript1.1">
function ChangeAmount(theForm){
document.theForm.amount.value="12.00";
}
</script>
</head>
<body>
<table width="600" height="400" bgcolor="#F8bf24" cellspacing="2" cellpadding="2" bordercolor="#0000ff" border="2" >
<th align="center"colspan="2">Kia's Kaps </th>
<tr><!-- Row 1 -->
<td align="center"><img src="../PinkPatriot.jpg" width="150" height="142" alt="" border="0">
<form name="form1" target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="text" name="amount" value="0.00">
<input type="hidden" name="cn" value="Comments or Questions?">
<table>
<tr>
<td><input type="hidden" name="on0" value="Size">Size</td>
<td><select name="os0" onChange=ChangeAmount(this.form)>
<option value="Small">Small
<option value="Medium">Medium
<option value="Large ">Large
<option value="X Large">X Large
<option value="XX Large">XX Large</select>
</td></tr></table>
<input type="image" src="https://www.paypal.com/images/sc-but-03.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="add" value="1">
</form><br>
</body>
</html>

Comment