• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Create a popup from a hyperlink

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 1044
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Author
Posts: 116
11
Spring Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 116
11
Spring Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I don't like that guy. The tiny ad agrees with me.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic