homepage Welcome to WebmasterWorld Guest from 54.196.201.253
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Java script pop up from hidden field
cyclic




msg:1484490
 2:49 pm on Mar 5, 2003 (gmt 0)

I have a mail list which responds to the form input by referring to a url in a hidden field

<input type="hidden" name="subscribe" value="url/subscribe.htm">

I want to put the response in a pop up window rather than a new page i.e. "Thank you for your interest"

How do I get:

value="url/subscribe.htm">

into a new window?

 

jpjones




msg:1484491
 3:05 pm on Mar 5, 2003 (gmt 0)

I presume subscribe.htm is the page your current form displays next, but is NOT the page your form currently submits to. I would expect you have something like

<form action="submit.cgi">

The only way I can think of, off the top of my head, is to use JavaScript to take all the values from your form, encode them into a format suitable for a url, and then use window.open(desturl,'windowname','windowoptions') to post to the actual form submission script. desturl would then be the url and the contents of each form element e.g.

submit.cgi?name=forename%20surname&age=25&blah=...

HTH,
JP

cyclic




msg:1484492
 3:09 pm on Mar 5, 2003 (gmt 0)

Thanks

The form action is a separate script on the server which gets the variable "subscribe" and then displays the url. I just want to put that URL in a new pop-up window.

jpjones




msg:1484493
 3:12 pm on Mar 5, 2003 (gmt 0)

The form action is a separate script on the server which gets the variable "subscribe" and then displays the url. I just want to put that URL in a new pop-up window.

That cannot be done server side. Opening new windows can only be done through JavaScript on the client side. Therefore, see above, or get the cgi program to return the filled out form (or empty form?) but with a

OnLoad="window.open('url/subscribe.htm','','');"

in the body tag.

JP

cyclic




msg:1484494
 3:42 pm on Mar 5, 2003 (gmt 0)

Sorry, the script is a php script on the server. As it is now the confirmation page appears in a new window "subscribe.htm"

As this is pulled from the script then I presume from what you are saying that it cannot be displayed in a pop-up without altering the php script?

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved