Hi RayI add this little bit of Javascript at the bottom of the web page:
<script language="JavaScript">function OK()
{ if (! confirm("Really delete this document?"))
{ returnfalse;
} returntrue;
};</script>
Here is the code for the delete button:
<ww:wwWebButtonID="btnDelete"runat="server"Text="Delete this document" onClientClick="return OK();" click="btnDelete_click" />
It works reliably.
Cheers
.. Geoff
I have a java script that prompts for confirmation before a delete but the webbutton always does the click event. The doc's say returning a false from the script will prevent the click event but it always fires for me. The script pops up and returns either true or false.
From the doc's:
"If you use OnClientClick() on a submit button the button will still submit the form unless you return false from your JavaScript handler. "
Is there another way to make this work?
Thanks
Ray
<ww:wwWebButtonID="btnSubmitDelete"runat="server"name="btnSubmitDelete"
onclientclick="ConfirmDelete()"
Click="btnSubmitDelete_Material_Click"Text="Delete" />
<code lang = "javascript">
<script>
function ConfirmDelete() {
var r = confirm("Are you sure you want to Delete this Entry?");
if (r == true) {
return true;
}
else {
return false;
}
}
</script>