开发者

Make javascript that redirects after opening a popup

I have the following constantcontact form they provided, After they click on submit, it opens a constant contact page. However I would like that it redirect also to a page after they click on submit

<form name=开发者_如何学JAVA"ccoptin" action="http://visitor.r20.constantcontact.com/d.jsp" target="_blank" method="post" style="margin-bottom:2;">
<input type="hidden" name="llr" value="cjdttecab">
<input type="hidden" name="m" value="1101813878050">
<input type="hidden" name="p" value="oi">
<font style="font-weight: normal; font-family:Arial; font-size:12px; color:#000000;">Email:</font> <input type="text" name="ea" size="20" value="" style="font-size:10pt; border:1px solid #999999;">
<input type="submit" name="go" value="Submit" class="submit" style="font-family:Verdana,Geneva,Arial,Helvetica,sans-serif; font-size:10pt;">
</form>


<form onsubmit="setTimeout(function() {location.replace('thanks.html');},100)"    
name="ccoptin" 
action="http://visitor.r20.constantcontact.com/d.jsp" 
target="_blank" 
method="post" 
style="margin-bottom:2;">

Alternatively go here http://community.constantcontact.com/t5/Documentation/Constant-Contact-Signup-Form-Generator-CCSFG/ba-p/25033 download the form generator and fill in the success url !!!

Found via this page

http://community.constantcontact.com/t5/User-Community/ct-p/userdiscussion


Since you're using JSP to parse the response, couldnt you just, at the end of your code that handles the form insert this:

response.sendRedirect("your/URL/here");

and just do this the normal way? or is there a reason you need to do this with javascript?

ahhhh n/m I just realized that you do not have control of the receiving script at constant contact - Don't they have a setting you can send to have the browser redirected back to a page of your choosing? I would look into that.

EDIT:

The timeout function below will work but it assumes the end user has javascript enabled. Furthermore, 100ms is not a lot of time to wait - if the network lags for any reason the post will not be sent so it will not work 100% of the time and thats a promise.

The proper way to do this, would be to use this: http://community.constantcontact.com/t5/Documentation/Constant-Contact-Signup-Form-Generator-CCSFG/ba-p/25033

To set up a privately hosted solution that uses the api. This requires pretty little programming knowledge at all and you'd still be able to skin the form you generate to match your site. It does run in PHP so your server would have to support that, but most do these days.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜