This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Create a popup from a hyperlink

 
Steven Mather
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, understand that I used to be a great programmer many, many years go but it's all very rusty.

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)
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
P.S. You can open a new window from your page, but that's not what you're after I believe.
 
Ivan Jozsef Balazs
Rancher
Posts: 990
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you present a custom page with contents as you wish including an internal frame with the link to that stuff?
 
Alex Theedom
Author
Ranch Hand
Posts: 77
5
Java Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the URL refers to a Servlet/JSP that responses with a well formed HTML page. You could place a onload() event on the body tag and call a javascript that creates a popup containing the info you want.

Is this an acceptable solution?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alex Theedom wrote:If the URL refers to a Servlet/JSP that responses with a well formed HTML page. You could place a onload() event on the body tag and call a javascript that creates a popup containing the info you want.

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
Author
Ranch Hand
Posts: 77
5
Java Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

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.

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Steven Mather
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All,

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.

Crap

Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, if all they allow you to specify is the URL, then you are at the mercy of what they do with that URL. If they want it to open in the same page, there's no way you can overcome that. How the URL is handled as a page is specified at a level higher than the URL itself.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic