ecojohnson
07-10-2001, 06:10 PM
I have a form where the user has the option of deleting an item from a database. I have the following Javascript function set up:
function DeleteMe() {
if (confirm ("Are you sure you want to delete the selected project?")){
document.forms[0].submit();
}else{
return false
}
}
In the form, I have the following set for the Delete button:
<INPUT TYPE="submit" NAME="Button" VALUE="Continue">
<INPUT TYPE="submit" NAME="Button" VALUE="Save">
<INPUT TYPE="button" NAME="Button" VALUE="Delete" ONCLICK="DeleteMe()">
On my action page, I have the following code set up:
<IF IsDefined ("form.button")>
do this
<ELSE>
do that
</IF>
If the user selects "Cancel" on the confirm message, nothing happens (as is expected). However, when the user selects "OK", the ELSE statement gets invoked. How do I get it under the initial IF statement?
function DeleteMe() {
if (confirm ("Are you sure you want to delete the selected project?")){
document.forms[0].submit();
}else{
return false
}
}
In the form, I have the following set for the Delete button:
<INPUT TYPE="submit" NAME="Button" VALUE="Continue">
<INPUT TYPE="submit" NAME="Button" VALUE="Save">
<INPUT TYPE="button" NAME="Button" VALUE="Delete" ONCLICK="DeleteMe()">
On my action page, I have the following code set up:
<IF IsDefined ("form.button")>
do this
<ELSE>
do that
</IF>
If the user selects "Cancel" on the confirm message, nothing happens (as is expected). However, when the user selects "OK", the ELSE statement gets invoked. How do I get it under the initial IF statement?



