Open browser from html area

Using Servoy to administrate the content of your website? Discuss all webrelated Servoy topics on this forum!

Open browser from html area

Postby Adelo Herrero » Fri Dec 30, 2011 7:24 pm

Hi all and a happy new year:

I have one form with that contains an html-area which show a html-form (method post) and I want that clicking the button, to open a browser with the corresponding page. But not working.

Any idea?

Best regards.
Adelo Herrero
Adelo Herrero
 
Posts: 103
Joined: Sat Jul 25, 2009 9:24 pm
Location: Requena (Valencia) España

Re: Open browser from html area

Postby ROCLASI » Fri Dec 30, 2011 8:48 pm

Hi Adelo,

Can you show us some code of what you are doing ?
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: Open browser from html area

Postby Adelo Herrero » Sat Dec 31, 2011 9:07 am

Good morning:

my code is:
Code: Select all
var    testOpenPagePostMethod='<html>\
      <head> \
      </head> \
      <body> \
         <form action="http://www.icarushotels.com" method="post" target="_blank"> \
            <input type="hidden" name="field_1" value="one">  \
            <input type="hidden" name="field_2" value="two"> \
            <input type="submit" name="sending" value="Send" border="0"> \
         </form> \
      </body> \
   </html> ';


This function is in the onOpen form and she shows correctly the button in the html-area, but when I click, not open the url in one new browser.
Thanks in advance.
Adelo Herrero
Adelo Herrero
 
Posts: 103
Joined: Sat Jul 25, 2009 9:24 pm
Location: Requena (Valencia) España

Re: Open browser from html area

Postby jcompagner » Mon Jan 09, 2012 6:48 pm

are we talking here about a web or smartclient?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Open browser from html area

Postby Adelo Herrero » Mon Jan 09, 2012 11:22 pm

In webclient.
Adelo Herrero
 
Posts: 103
Joined: Sat Jul 25, 2009 9:24 pm
Location: Requena (Valencia) España

Re: Open browser from html area

Postby jcompagner » Wed Jan 11, 2012 11:29 am

the thing that could go wrong is that we already have a <form> tag, that wraps everything.
And i think nested form tags are not really legal in the browser.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Open browser from html area

Postby ngervasi » Wed Jan 11, 2012 12:55 pm

You can workaround it by using the HTTP plugin for the post action and invoking the servoy method from the html area, it has also the benefit that let's you keep all your logic inside servoy methods and not deep buried into html. To call a servoy method from a not-editable html area use: <a href="javascript:yourMethodName()"></a>.
Nicola Gervasi
sintpro.com
SAN Partner
ngervasi
 
Posts: 1485
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy

Re: Open browser from html area

Postby Adelo Herrero » Thu Jan 12, 2012 8:10 pm

Hello:

Really I not have call a servoy method, but I have to open an url in separate browser.

The idea is sending to PayPal the required data for post method, and show the PayPal page in another browser.

This work fine in html, but if I put the html code in the html area not working.

Otherwise, if I use the http plugin, I can not show the page, I can only receive the page code.

Thanks in advance.
Adelo Herrero
Adelo Herrero
 
Posts: 103
Joined: Sat Jul 25, 2009 9:24 pm
Location: Requena (Valencia) España


Return to Web Development

Who is online

Users browsing this forum: No registered users and 2 guests