Corvette90
Programmer
OK, i have a very simple javascript function that works fine in IE but triggers form.submit in NN7.1
Can anyone explain why?
Can anyone explain why?
Code:
<html>
<head>
<title> New Document </title>
</head>
<script language="JavaScript">
<!--
function addField(){
for(var i=0; i < document.getElementById("fields").length; i++){
if(document.getElementById("fields")[i].selected)
document.getElementById("display_fields").options.add(new Option(document.getElementById("fields")[i].text, document.getElementById("fields")[i].value));
}
}
function removeField(){
for(var i=(document.getElementById("display_fields").length-1); i >= 0; i--){
if(document.getElementById("display_fields")[i].selected)
document.getElementById("display_fields").options[i] = null;
}
}
//-->
</script>
<body>
<form action="registrant_list.jsp" id="create_report_form" method="post">
<table>
<tr>
<td>
<select id="fields" multiple="true" size="16">
<option value="address.address1">Address1</option>
<option value="address.address2">Address2</option>
<option value="address.address3">Address3</option>
<option value="address.city">City</option>
<option value="address.state">State</option>
<option value="address.zip">Zip Code</option>
<option value="address.province">Province</option>
<option value="address.country">Country</option>
<option value="address.phone">Phone</option>
<option value="address.fax">Fax</option>
<option value="session.time_part">Session Time</option>
<option value="reg_type.display_name">Registraion Type</option>
<option value="cust_order.paid_in_full">Paid in Full</option>
<option value="">Extra Computer Connections</option>
<option value="">Extra Phone Connections</option>
<option value="">Order Date</option>
</select>
</td>
<td align="center">
<button onclick="addField()"> >> </button>
<br/>
<br/>
<br/>
<button onclick="removeField()"> << </button>
</td>
<td>
<select id="display_fields" multiple="true" size="16" style="width:200px">
</select>
</td>
</tr>
<tr>
<td></td>
<td></td>
<td align="right"><input type="submit"></td>
</tr>
</table>
</form>
</body>
</html>