S
Steve Brecher
I have some code comprising the onsubmit attrribute of a form. The code is
executing, but apparently a function called as the last statement is not
executed. The form content is submitted to the server. The behavior is the
same in Firefox and IE (current Windows versions). The following is
excerpted from the browser's "View source":
<script type="text/javascript">
function verify(f)
{
var msg;
var empty_fields = "";
var unselected = "";
var selected = 0;
alert('In verify()'); // not executed
// ...
}
</script>
<form name="ccform" id="ccform" method="post" action="/admin/index.php"
onsubmit="
alert('In onsubmit 1'); // executed
this.type.oneRequired = true;
this.donationtype.oneRequired = true;
this.fname.required = true;
this.lname.required = true;
this.email.required = true;
alert('In onsubmit 2'); // executed
return verify(this);
">
executing, but apparently a function called as the last statement is not
executed. The form content is submitted to the server. The behavior is the
same in Firefox and IE (current Windows versions). The following is
excerpted from the browser's "View source":
<script type="text/javascript">
function verify(f)
{
var msg;
var empty_fields = "";
var unselected = "";
var selected = 0;
alert('In verify()'); // not executed
// ...
}
</script>
<form name="ccform" id="ccform" method="post" action="/admin/index.php"
onsubmit="
alert('In onsubmit 1'); // executed
this.type.oneRequired = true;
this.donationtype.oneRequired = true;
this.fname.required = true;
this.lname.required = true;
this.email.required = true;
alert('In onsubmit 2'); // executed
return verify(this);
">