[web2py] Re: cancel button in update and create work differently [closed]

2010-06-01 Thread annet
Yes, you're right, I hadn't thought of that. Thanks for providing me with a better solution. Kind regards, Annet.

[web2py] Re: cancel button in update and create work differently [closed]

2010-06-01 Thread Iceberg
history.go(-1) will not work if the current page is the first page of current browser session. Will this help you? On Jun1, 8:00pm, annet wrote: > Setting the cancel button to: > > form[0][-1] > [1].append(INPUT(_type="button",_value="Cancel",_onclick='javascript:histor > y.go(-1);')) > > at

[web2py] Re: cancel button in update and create work differently [closed]

2010-06-01 Thread annet
Setting the cancel button to: form[0][-1] [1].append(INPUT(_type="button",_value="Cancel",_onclick='javascript:history.go(-1);')) at least gives the user a way to cancel the function, not the way I wanted it, but it's better than getting an error. Annet

Re: [web2py] Re: cancel button

2010-02-16 Thread Jonathan Lundell
On Feb 16, 2010, at 12:18 PM, reyelts wrote: > I'm trying to use this with my shiny new SQLFORM. But I'm clearly > missing something. Here's a snippet: > > form = SQLFORM(...blah...) > submit = form.element(_type='submit') > > submit.parent.append(INPUT(_type='submit',_value='Cancel',_name='

[web2py] Re: cancel button

2010-02-16 Thread mdipierro
if request.vars.button == 'Cancel': session.flash = 'profile create was cancelled' session.flash = 'profile update was cancelled' redirect(URL(r=request,f='index')) elif form.accepts(request.vars,session,dbio=False): del request.vars.button ...update/insert logic

[web2py] Re: cancel button

2010-02-16 Thread reyelts
I'm trying to use this with my shiny new SQLFORM. But I'm clearly missing something. Here's a snippet: form = SQLFORM(...blah...) submit = form.element(_type='submit') submit.parent.append(INPUT(_type='submit',_value='Cancel',_name='button')) if request.vars.button == 'Cancel': s

Re: [web2py] Re: cancel button

2010-02-07 Thread Jonathan Lundell
On Feb 7, 2010, at 6:31 PM, mdipierro wrote: > The patch by Mr Freeze is in. Thanks. I'll wait for a stable release, but I'll definitely use it. Some documentary comments would be nice. (BTW, the patch added trailing white space to a few lines. Bogus, I assume.) > > On Feb 7, 4:27 pm, mdipier

[web2py] Re: cancel button

2010-02-07 Thread mdipierro
The patch by Mr Freeze is in. On Feb 7, 4:27 pm, mdipierro wrote: > The patch will be in soon. ;-) > > On Feb 7, 4:18 pm, Jonathan Lundell wrote: > > > On Feb 7, 2010, at 2:06 PM, mr.freeze wrote: > > > > I hate this too: form[0][-1][1]. I have a pending patch that will > > > allow you to grab p

Re: [web2py] Re: cancel button

2010-02-07 Thread Jonathan Lundell
On Feb 6, 2010, at 9:33 PM, Iceberg wrote: > Yes, but be careful of multiple submit buttons. See this post: > https://groups.google.com/group/web2py/browse_frm/thread/f44b6f95b058df5 I think I've solved the multiple-submit problem, at the cost of a bit of scripting (but not much): form[0][

[web2py] Re: cancel button

2010-02-07 Thread mdipierro
The patch will be in soon. ;-) On Feb 7, 4:18 pm, Jonathan Lundell wrote: > On Feb 7, 2010, at 2:06 PM, mr.freeze wrote: > > > I hate this too: form[0][-1][1]. I have a pending patch that will > > allow you to grab parent and sibling elements so you can do: > form = SQLFORM(db.whatever) > >

Re: [web2py] Re: cancel button

2010-02-07 Thread Jonathan Lundell
On Feb 7, 2010, at 2:06 PM, mr.freeze wrote: > I hate this too: form[0][-1][1]. I have a pending patch that will > allow you to grab parent and sibling elements so you can do: form = SQLFORM(db.whatever) submit = form.element(_type='submit') submit.parent.append(INPUT(_type='submit'

[web2py] Re: cancel button

2010-02-07 Thread mr.freeze
I hate this too: form[0][-1][1]. I have a pending patch that will allow you to grab parent and sibling elements so you can do: >>> form = SQLFORM(db.whatever) >>> submit = form.element(_type='submit') >>> submit.parent.append(INPUT(_type='submit',_value='Cancel')) A little more verbose but human r

Re: [web2py] Re: cancel button

2010-02-07 Thread Jonathan Lundell
On Feb 6, 2010, at 9:33 PM, Iceberg wrote: > On Feb7, 8:01am, Jonathan Lundell wrote: >> On Feb 6, 2010, at 12:58 PM, Jonathan Lundell wrote: >> >>> On Feb 6, 2010, at 12:38 PM, mdipierro wrote: >> form[0][-1][1].append(BUTTON(_onclick="")) >> >>> Thanks. >> >>> Ideally, I'd like to

[web2py] Re: cancel button

2010-02-06 Thread weheh
Is it reasonable to expect this to work on crud forms, as well? I would think so, but I'm having difficulty getting it to work. -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsu

[web2py] Re: cancel button

2010-02-06 Thread Iceberg
On Feb7, 8:01am, Jonathan Lundell wrote: > On Feb 6, 2010, at 12:58 PM, Jonathan Lundell wrote: > > > On Feb 6, 2010, at 12:38 PM, mdipierro wrote: > > >> form[0][-1][1].append(BUTTON(_onclick="")) > > > Thanks. > > > Ideally, I'd like to return to the form.accepts call in such a way that the

Re: [web2py] Re: cancel button

2010-02-06 Thread Jonathan Lundell
On Feb 6, 2010, at 12:58 PM, Jonathan Lundell wrote: > On Feb 6, 2010, at 12:38 PM, mdipierro wrote: > >> form[0][-1][1].append(BUTTON(_onclick="")) > > Thanks. > > Ideally, I'd like to return to the form.accepts call in such a way that the > accepts return test can recognize the cancelati

Re: [web2py] Re: cancel button

2010-02-06 Thread Jonathan Lundell
On Feb 6, 2010, at 12:38 PM, mdipierro wrote: > form[0][-1][1].append(BUTTON(_onclick="")) Thanks. Ideally, I'd like to return to the form.accepts call in such a way that the accepts return test can recognize the cancelation and then redirect as necessary. Somewhat parallel to testing form

[web2py] Re: cancel button

2010-02-06 Thread mdipierro
form[0][-1][1].append(BUTTON(_onclick="")) On Feb 6, 12:09 pm, Jonathan Lundell wrote: > I seem to be full of elementary questions this week. > > I've got a simple SQLFORM to add a row to a database, and I want to have a > cancel button along with the submit button. > > How? -- You receive