Forum Moderators: open

Message Too Old, No Replies

I Need to Open A Window Upon Submission of Form

Complicated because I can't access the cgi-bin or edit the default page.

         

contentsiteguy

4:43 pm on May 10, 2004 (gmt 0)

10+ Year Member



I just can't figure out this javascript stuff and I figure there's bound to be someone a lot smarter than me here.

I have a form the hosting company gave me that signs up subscribers to a newsletter (which they also host) and I am trying to open a new page upon submission to track where subscribers come from and also allow them to download free software from the new window.

Currently the visitor is sent to a default "Welcome to My Newsletter" page upon submission of the form.

The problem is I don't have access to the cgi-bin on the server and I can't edit their default page. Is there some kind of javascript code or something I can do to achieve what I want to do?

Here is the code in it's current form:

<form action="http://www.mydomain.com/cgi-bin/mailing/mailer.cgi" method=post>
<input type="hidden" name="list_id" value="15">
<input type="hidden" name="action" value="subscribe">
<TABLE border="0" cellspacing="0" align="center" cellpadding="2" bgcolor="#FFFFFF"><TR><TD>
<TABLE cellpadding="4" cellspacing="0" border="0" bgcolor="#FFFFFF">
<TR align="center"><TD align="right" nowrap><B><FONT face="Verdana, Arial, Helvetica, sans-serif" size="2">Enter Your E-mail Address
</FONT></B></TD><TD valign=top ><INPUT name="email" type="TEXT" size="30"></TD></TR>
<TR align="center"><TD align="right" nowrap><B>
<FONT face="Verdana, Arial, Helvetica, sans-serif" size="2">Enter Your First Name (optional)
</FONT></B></TD><TD valign=top><INPUT name="name" type="TEXT" size="30"></TD></TR>
<TR align="center"><TD valign=top colspan="2">
<INPUT type="SUBMIT" value="Click Here to Subscribe" name="SUBMIT"></TD>
</TR></TABLE></TD></TR></TABLE></form>

vkaryl

12:00 am on May 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are you able/allowed to edit what you posted? Or is that also a non-starter? Or is what you posted the "default page" to which you refer?

No cgi-bin access is a pretty poor situation as regards hosting any more.... maybe you need to look for another one.

contentsiteguy

5:29 pm on May 11, 2004 (gmt 0)

10+ Year Member



Yes I can edit what I posted and I can create and edit any page on my site except for the default thank you page upon submission of that form. It's a double opt-in subscription so they also automatically receive a confirmation link too if that helps.

vkaryl

11:59 pm on May 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So if you put code like this into your form structure, it refuses to redirect except to their default?

<INPUT type="hidden" name="redirect" value="http://www.example.com/thankyou.html">

contentsiteguy

3:20 am on May 15, 2004 (gmt 0)

10+ Year Member



I just tried your suggestion with no luck. Maybe I put it in the wrong place or something or was I supposed to have removed the first line or what? If anyone can help please let me know. Here's the suggestion I tried:

<form action="http://www.mydomain.com/cgi-bin/mailing/mailer.cgi" method=post>
<input type="hidden" name="list_id" value="15">
<input type="hidden" name="action" value="subscribe">
<INPUT type="hidden" name="redirect"
value="http://www.mydomain.com/thank-you.html">
<TABLE border="0" cellspacing="0" align="center" cellpadding="2" bgcolor="#FFFFFF"><TR><TD>
<TABLE cellpadding="4" cellspacing="0" border="0" bgcolor="#FFFFFF">
<TR align="center"><TD align="right" nowrap><B><FONT face="Verdana, Arial, Helvetica, sans-serif" size="2">Enter Your E-mail Address
</FONT></B></TD><TD valign=top ><INPUT name="email" type="TEXT" size="30"></TD></TR>
<TR align="center"><TD align="right" nowrap><B>
<FONT face="Verdana, Arial, Helvetica, sans-serif" size="2">Enter Your First Name (optional)
</FONT></B></TD><TD valign=top><INPUT name="name" type="TEXT" size="30"></TD></TR>
<TR align="center"><TD valign=top colspan="2">
<INPUT type="SUBMIT" value="Click Here to Subscribe" name="SUBMIT"></TD>
</TR></TABLE></TD></TR></TABLE></form>

vkaryl

7:34 pm on May 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hmm. Well, in the form I have that I snipped that example <input> line from, it's the last line before the closing </form> tag - though I'm not sure that makes any difference at all.

Try that, and if it's not that, then you just can't redirect to another page on this host, apparently. Which is a crock....

Edit: after a bit more thought.... taking out the first line won't help, because it's the one which accessess your mailer program as provided by your host. And since you can't install anything else in the cgi-bin.... bottom line advice: find a different host....

wavebird23

11:55 pm on May 15, 2004 (gmt 0)

10+ Year Member



To make a thank you note popup when a form is submitted:
1. Enter the below code into the HEAD section of your webpage:
______________________________________________________
<script type="text/javascript">
function createTarget(t){
window.open("", t, "width=600,height=550");
return true;
}
</script>
______________________________________________________
2. Put the below tag into your form:
______________________________________________________
<form action="http://www.mydomain.com/cgi-bin/mailing/mailer.cgi" method="post" onsubmit="return createTarget(this.target)" target="formtarget">
______________________________________________________
3. Change "this.target" into the html page that you want the popup to be of example: thankyoupage.html

These scripts work with most web hosts. Good luck with your site!