Adding a attributes to SQLFORM would be better... The way you do it, mean that you will need to include your little script in every view.
Richard On Wed, Oct 17, 2012 at 8:18 AM, Mandar Vaze <mandarv...@gmail.com> wrote: > > > On Tuesday, March 23, 2010 10:32:19 AM UTC+5:30, Jonathan Lundell wrote: >> >> no loss of functionality), but more important it allows us to have an >> option to SQLFORM.__init__() to override the text associated with the >> confirmation. 'Sure you want to delete this object?' is somewhat >> idiosyncratic English to begin with, but the main problem is that usually >> we'd like to be more specific than "this object". Depending on the record, >> we might say "this item" or "this item in your cart" or "this user" or any >> number of things. >> > I have achieved this by overriding variable w2p_ajax_confirm_message as > follows : > > {{extend 'layout.html'}} > +<script> > + var w2p_ajax_confirm_message = "{{=T('Are you sure you want to > remove this item from cart?')}}"; > +</script> > > > It seems to be work for me. (on web2py 2.0.9 - if it matters) > Do you see any problem with this approach ? > > -Mandar > >> -- > > > > --