List Info

Thread: Assign a confirmation box when clicking inside of a bound event




Assign a confirmation box when clicking inside of a bound event
country flaguser name
United States
2007-10-25 01:40:14
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


Re: Assign a confirmation box when clicking inside of a bound event
country flaguser name
United States
2007-10-25 10:44:45
Use a confirm()

if(confirm('text of question?')){
  ... // do it
}else{
  ... // don't do it
}

On Oct 25, 7:40 am, paulp75 <ppurc...iinet.net.au> wrote:
> 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


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )