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
history.go(-1) will not work if the current page is the first page of
current browser session.
Will this help you? INPUT TYPE=RESET VALUE=Start All Over
On Jun1, 8:00pm, annet annet.verm...@gmail.com wrote:
Setting the cancel button to:
form[0][-1]
Yes, you're right, I hadn't thought of that. Thanks for providing me
with a better solution.
Kind regards,
Annet.
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':
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
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')
On Feb 6, 2010, at 9:33 PM, Iceberg wrote:
On Feb7, 8:01am, Jonathan Lundell jlund...@pobox.com 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
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 readable
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')
The patch will be in soon. ;-)
On Feb 7, 4:18 pm, Jonathan Lundell jlund...@pobox.com 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 =
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):
The patch by Mr Freeze is in.
On Feb 7, 4:27 pm, mdipierro mdipie...@cs.depaul.edu wrote:
The patch will be in soon. ;-)
On Feb 7, 4:18 pm, Jonathan Lundell jlund...@pobox.com 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
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, mdipierro
form[0][-1][1].append(BUTTON(_onclick=))
On Feb 6, 12:09 pm, Jonathan Lundell jlund...@pobox.com 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?
--
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
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 cancelation and
On Feb7, 8:01am, Jonathan Lundell jlund...@pobox.com 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
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
18 matches
Mail list logo