Welcome to WebmasterWorld Guest from 107.20.110.201

Forum Moderators: open

Message Too Old, No Replies

Java script pop up from hidden field

     

cyclic

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

10+ Year Member



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

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

10+ Year Member



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

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

10+ Year Member



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

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

10+ Year Member



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

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

10+ Year Member



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?

 

Featured Threads

Hot Threads This Week

Hot Threads This Month