In my form, I have a button called "Search". When user clicks on this button, a small pop-up window will appear. The codes are as below:
Code:
<script language="JavaScript" type="text/javascript">
function doLookup() {
// pop-up window
}
function checkForm() {
alert("Check Form");
return true;
}
</script>
<form name="form" method="post" onSubmit()="return checkForm();">
<tr>
<td><input type="image" name="searchBtn" onClick="lookUp();return false"></td>
</tr>
</form>
The pop-up window will display a list of student name. When user selects a name and clicks "OK" button. The page will call a javascript function to submit opener's form and closes the pop-up window. The script are as below:
Code:
function submitForm() {
opener.document.form.submit();
opener.focus();
window.close();
}
What I don't understand is after the pop-up window has been closed, the form did submit. But why I can't see an alert message pop-up?
I would like to apologize if my explanation is confusing. And I would try my best to explain it if requested.
Thanks in advanced.