[jQuery] Assign a confirmation box when clicking inside of a bound event
When i do a search it comes up with the results with this method
$(function() { var options = {
target: '#searchresults' // target element(s) to be
updated with server response
};
// bind form using 'ajaxForm'
$('#form1').ajaxForm(options);
after this call, i want the option to delete products from the
database, but i'm only able to do this at this stage without any sort
of confirmation which can be quite dangerous as I could lose important
information.
this is my current code, to allow me to do this after the search call,
within the results.
$('#searchresults').bind('click',function(event){
if($(event.target).is('.deleteproduct'))
{
$('.deleteproduct').click(function(){
$.post("jqjobdelete.php", { jobid: this.id } );
$(this).parents("tr").fadeOut(500);return false;
});
}
});
How would I be able to have this delete only take place after a
confirmation message such as "Are you sure?"
thanks for any help