How can I open a page on a new tab?

61 views
Skip to first unread message

csavorgn

unread,
Apr 17, 2014, 3:41:35 AM4/17/14
to web...@googlegroups.com
Hi,
I'm using a SQLFORM.factory to let the user enter some data and I added a button using

buttons=[INPUT(_type="submit",_value="Go!")]

When "Go!" is pressed a new page is opened using the following code:

if form.process().accepted:
            redirect(URL("default","go", vars=dict(name=form.vars.name)))

Is there a way to open the page ".../default/go?name=carlo#" in a new tab?
Thanks
Carlo

Oli

unread,
Apr 17, 2014, 11:26:58 AM4/17/14
to web...@googlegroups.com
 
URL('Link for a new tab', _class="btn" , _title=T("in a new tab"), _href=URL("default","yourcontroller",args=[row.id]), _target='_blank')

csavorgn

unread,
Apr 17, 2014, 12:35:48 PM4/17/14
to web...@googlegroups.com
Thank you for your answer but I don't understand how I should use the code. Can you explain a bit more?
Carlo

Dave S

unread,
Apr 17, 2014, 2:21:45 PM4/17/14
to web...@googlegroups.com


On Thursday, April 17, 2014 8:26:58 AM UTC-7, Oli wrote:
 
URL('Link for a new tab', _class="btn" , _title=T("in a new tab"), _href=URL("default","yourcontroller",args=[row.id]), _target='_blank')

I may be missing something, but this looks like it makes a button that when pressed goes direct to a new tab.  I think csavorgn wanted to process the form normally, using the button to submit it, but to have a new tab (or popup?) for the post-processing destination.  Am I off track here?

/dps

 

csavorgn

unread,
Apr 17, 2014, 3:34:14 PM4/17/14
to web...@googlegroups.com
Dave, you are right. I want to process the form normally and then, after pressing the button, I would like to get a new tab (also a popup would be fine).
Thanks
Carlo 

csavorgn

unread,
Apr 17, 2014, 3:34:24 PM4/17/14
to web...@googlegroups.com
Dave, you are right. I want to process the form normally and then, after pressing the button, I would like to get a new tab (also a popup would be fine).
Thanks
Carlo 

On Thursday, April 17, 2014 8:21:45 PM UTC+2, Dave S wrote:
Reply all
Reply to author
Forward
0 new messages