Yes, you're right, I hadn't thought of that. Thanks for providing me
with a better solution.
Kind regards,
Annet.
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
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
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='
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
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
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
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
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][
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)
> >
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'
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
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
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
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
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
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
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
18 matches
Mail list logo