[web2py] confirmation dialog on delete

2010-05-05 Thread annet
The jQuery code for confirmation on delete connects the onclick event
of the checkbox with a confirmation dialog. I would like this
confirmation dialog to be triggered by the submit button.

Is it possible to re-write the code in web2py_ajax.html:

jQuery(input[type='checkbox'].delete).click(function() { if
(this.checked) if(!confirm({{=T('Sure you want to delete this
object?')}})) this.checked=false; });

... so that the code connects to the onclick event of the submit and
not the onclick event of the checkbox?


Kind regards,

Annet.


Re: [web2py] confirmation dialog on delete

2010-05-05 Thread Jason Brower
It would recommend doing your own jquery code for that.  Then based on
the id of the button you can have it do anything you like.
The jquery webpage is good to look at for this information.
Best Regards,
Jason

On Wed, 2010-05-05 at 02:50 -0700, annet wrote: 
 The jQuery code for confirmation on delete connects the onclick event
 of the checkbox with a confirmation dialog. I would like this
 confirmation dialog to be triggered by the submit button.
 
 Is it possible to re-write the code in web2py_ajax.html:
 
 jQuery(input[type='checkbox'].delete).click(function() { if
 (this.checked) if(!confirm({{=T('Sure you want to delete this
 object?')}})) this.checked=false; });
 
 ... so that the code connects to the onclick event of the submit and
 not the onclick event of the checkbox?
 
 
 Kind regards,
 
 Annet.