Forum Moderators: open
Runtime Error
undefined is null or not an object.
My code that calls the javascript alert box is:
<form action="/exhibitorhousing/housing-delete.asp" method="post" onSubmit="Delete(this. form); return false"><input type=hidden name="HOUSING_REQUEST_ID" value="<%= HOUSING_REQUEST_ID %>"><input type=hidden name="MODE" value="DELETE"><input type=submit value="Delete"></form>
The Javascript is:
function Delete(thisform) {
if (confirm("Are you sure you want to delete this reservation?"))
thisform.submit();
}
Any thoughts on how I can eliminate this problem?
Thanks.
Here is the code:
<form action="/exhibitorhousing/housing-delete.asp" method="post" onSubmit="return Delete(this. form)"><input type=hidden name="HOUSING_REQUEST_ID" value="<%= HOUSING_REQUEST_ID %>"><input type=hidden name="MODE" value="DELETE"><input type=submit value="Delete"></form>
the script:
function Delete(thisform) {
if (confirm("Are you sure you want to delete this reservation?"))
return true;
}else{
return false;
}
It will work with that extra brace at the bottom to close the function.
Because there was a syntax error in the function (no curly brace at the bottom) the javascript was ignored and your form was processed without it.
If you want to test your page code without updating anything, just comment out the cmd.execute lines in your ASP code.