
Sir i have used following code in button delete onclick="if (confirm('sure?')) submit();"
and if i choose cancel it still submits the form however if choose cancel i want to remain on same jsp page
please help

The given code works fine here.Use it:
<script language="javascript">
function deleteRecord(id){
var doIt=confirm('Do you want to delete the record?');
if(doIt){
var f=document.form;
f.method="post";
f.action='../DeleteServlet?id='+id;
f.submit();
}
else{
}
}
</script>
Don't use, onclick="if (confirm('sure?')) submit();".
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.