posted 18 years ago
I'm having a problem trying to submit a form with an OnChange event on a Select. I'm running this in IE6. I tested my function to make sure it is called. But my form does not get submitted. Is this a problem with hidden variables on the form or not sure if the form is accessible to the function.
Any help would be appreciated ! Thanks!
Here are snippets of my code -
/**********************************************************************/
<html>
<head>
<title>New Order</title>
<script language="Javascript">
function displayFields()
{
var qty=document.orderForm.quantity.selectedIndex;
document.orderForm.submit.value = "0";
document.orderForm.num_selected.value = qty+1;
document.orderForm.dd_selected.value = "1";
document.orderForm.submit();
}
</script>
<table width="576" border="1" cellspacing="0" cellpadding="0">
<tr>
<td>
<form method="post" action="ControllerServlet" name="orderForm">
<input type="hidden" name="cmd" value="NEW_ORDER" />
<input type="hidden" name="submit" value="1" />
<input type="hidden" name="dd_selected" value="0" />
<input type="hidden" name="num_selected" value="0" />
<table width="556" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td width="10%"> </td>
<td width="90%">
1) <span class="modComment">Quantity to Add:</span>
<select name="quantity" onchange="displayFields()" >
<option value="1" >1</option>
<option value="2" >2</option>
<option value="3" >3</option>
<option value="4" >4</option>
</select>
</td>
</tr>