I am having a confirmation box after clicking on the “Delete ” link in the jsp. Now the problem is that the success deletion page is showing in the same window.
I would like to show it in a pop up window.
I tried to use the javascript onclick(), but it is not wotking. So, how can I do that?
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="jconfirmaction.jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.ask-plain').click(function(e) {
e.preventDefault();
thisHref = $(this).attr('href');
if(confirm('Delete this record?')) {
window.location = thisHref;
}
});
$('.ask-custom').jConfirmAction({question : "Anda Yakin?", yesAnswer : "Ya", cancelAnswer : "Tidak"});
$('.ask').jConfirmAction();
});
</script>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<SCRIPT TYPE="text/javascript">
<!--
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href, windowname, 'width=750,height=430,scrollbars=no');
return false;
}
//-->
</SCRIPT>
---Delete image
<td width="3%" align="left"><a href="cir_delete.jsp?cir_id=<%=rs.getString("cir_id")%>" class="ask"><IMG SRC="12.png" ALT="Delete" BORDER="0"></a></td>
Thanx
when you click on delete, the confirmation box is shown and afterwards the form is submit.
What you need to do is submit the form trough jquery, cathc the result and show pass it to a popup box. I will give an exmaple soon.
I have done this once with jconfirm:
I assume you want to use a modal popup like colorbox or something
define a div at the bottom where you can load html in after the post and hide it: