Context: I'm using a third party tool to build a web site. There is a third-party form builder tool where one of the properties is 'Thank you URL' I want to create my custom Thank You window as a pop-up separate from the current window/tab. Since all I can enter into the property field is a URL I’m trying to figure out the best way to do this but I don’t know the best way, correct way, won't display because pop-ups disabled, etc. NOTE: The Form Builder Tool only allows you to enter a URL in the display 'Thank You URL' so this limits my options.
These are the only options I can think of.
Option 1) Create a servlet on the server that uses open new window with scrollbars, toolbars, etc. disabled and references my 'thankyou.htm.' Can a servlet make the client show a popup? Will this bypass no popups setting? Any other issues that I'm not thinking of?
Option 2) I would set the property to the 'thankyou.htm' file but I can't figure out a way to set the properties of a window internally with CSS or something like'‘.popup width="400px", height="400px", etc.' and assign it to <body> or <head>. Remember, I haven't had to write HTML in years.
I appreciate any feedback, scathing or otherwise. If you do know how to do this can you post a code snippet (just a couples of the important lines, I can figure the rest out – I think)
Steven Mather wrote:Option 1) Create a servlet on the server that uses open new window
Servlets cannot open new windows. Nothing on the server can. Servlets and other server-side responders just return a response into whatever window issued the request.
Option 2) I would set the property to the 'thankyou.htm' file but I can't figure out a way to set the properties of a window internally with CSS or something like'‘.popup
CSS can't turn a window into a popup either.
If all you get to set is the URL, you're pretty much stuck with what they give you.
Is this an acceptable solution?
Is this an acceptable solution?
From the description from the OP, he has no ability to add anything to the original page -- all he can set is a property that indicates what the URL of his "thank you" page is. So injecting script into the original page is not an option.
Alex Theedom wrote:If the URL can refer to a resource on a different server (www.example.com/myapp/thankyou) he would then be free to do as I suggested.
That will not achieve his goal which is to cause the new page to open in a new window, leaving the original intact. Whether the URL to the new page is local or remote is irrelevant.
If it had been possible to specify the target of the URL he could have given it the value "_blank" which would popup a new page.
Yes, a target of "_blank" on an anchor tag (or form) will generate a new window, but that's not an option he has been given.
Thanks for the timely responses. From what I remember could I do something like this.
Okay, I used to create dynamic pages using script. When the URL was called script in the source could do all sorts of things. Open a database, get date, print out any content I wanted in well formed HTML and then that page would be displayed. Corret?
Since all I can can enter is the URL of the Thank You page (i.e. 'thankyou.htm') can I use what the one poster suggested, onload(), or something similar to modify the page and return that dynamic content. For instance, can I change the width, height, remove toolbars, etc. as I build the dynamic page from the internal script? I suppose another big problem I would have is making it show as a pop-up in a 'new' window instead of just displaying the returned content in the current tab from where the thank you URL was called.
The more I think about it I don't think I can do what I want. All I can do is create a static or dynamic page that displays in the current browser tab/window and the user would have to hit the back button to return to the initial page or put a link on the Thank You page that would return them to the site.