Question : Submit form to external action file and redirect page on one submit button

I have an email signup form for an external service (constant contact) on a splash page.

The code is below. I wanted to have the submit button both submit the form and redirect the page from the splash to main page, however I can't get the multiple actions to work.

I am limited in the sense that I have to have constant contact's form action, it pops up in a new window.

Any suggestions?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
  <head>
    <title>Welcome to ____</title>
    <link rel="stylesheet" type="text/css" href="/styles.css" />

<script type="text/javascript">
function submitform()
{
  document.myform.submit();
  window.location = "http://www.____.com";
}
</script> 

    <script type="text/javascript">
    try {
    var pageTracker = _gat._getTracker("UA-876977-25");
    pageTracker._trackPageview();
    } catch(err) {}</script>
  </head>
<body style="margin:0px; padding:0px; background-image:url(___/bg_texture.png);">
<div id="splashbox">
<div id="splashform">
<!-- BEGIN: Constant Contact Form -->
<form name="ccoptin" action="http://visitor.constantcontact.com/d.jsp" target="_blank" method="post">
<input type="text" name="ea" size="26" value="&nbsp;email:" style="font-family:Verdana,Geneva,Arial,Helvetica,sans-serif; font-size:18px; border:1px solid #DDDDDD; height:24px; line-height:24px;">
<br /><br />
<input onclick='submitform();' type="image" src="____/splashsubmit.png" >
<input type="hidden" name="m" value="1102336606191">
<input type="hidden" name="p" value="oi">
</form>
<!-- END: Constant Contact Stylish Email Newsletter Form -->
<!-- BEGIN: SafeSubscribe -->
<a href="http://www.constantcontact.com/safesubscribe.jsp" target="_blank">Privacy by SafeSubscribe&#8480;</a>
<br />
<a href="http://www._____.com">Continue to main page</a>
<!-- END: SafeSubscribe -->
</div>
</div>
<div id="splashfooter">

</div>
</body>
</html>

Answer : Submit form to external action file and redirect page on one submit button

Wild shot, but maybe try posting with AJAX (uses jquery)
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
<html> 
  <head>       
    <title>Welcome to ____</title> 
    <link rel="stylesheet" type="text/css" href="/styles.css" /> 
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> 
<script type="text/javascript"> 
function submitform() {
  ea = $("#ea").val();
  m = $("#m").val();
  p = $("#p").val();
  
  $.post("http://visitor.constantcontact.com/d.jsp", { 
		 ea: ""+ea+"", 
		 m: ""+m+"",
		 p: ""+p+""
		 },
      function(data){
    		window.location="http://www.____.com";
   });  
} 
</script>  
 
    <script type="text/javascript"> 
    try { 
    var pageTracker = _gat._getTracker("UA-876977-25"); 
    pageTracker._trackPageview(); 
    } catch(err) {}</script> 
  </head> 
<body style="margin:0px; padding:0px; background-image:url(___/bg_texture.png);"> 
<div id="splashbox"> 
<div id="splashform"> 
<!-- BEGIN: Constant Contact Form --> 
<form name="ccoptin" action="http://visitor.constantcontact.com/d.jsp" target="_blank" method="post"> 
<input type="text" name="ea" id="ea" size="26" value="&nbsp;email:" style="font-family:Verdana,Geneva,Arial,Helvetica,sans-serif; font-size:18px; border:1px solid #DDDDDD; height:24px; line-height:24px;"> 
<br /><br /> 
<input onclick='submitform();' type="image" src="____/splashsubmit.png" > 
<input type="hidden" name="m" id="m" value="1102336606191"> 
<input type="hidden" name="p" id="p" value="oi"> 
</form> 
<!-- END: Constant Contact Stylish Email Newsletter Form --> 
<!-- BEGIN: SafeSubscribe --> 
<a href="http://www.constantcontact.com/safesubscribe.jsp" target="_blank">Privacy by SafeSubscribe&#8480;</a> 
<br /> 
<a href="http://www._____.com">Continue to main page</a> 
<!-- END: SafeSubscribe --> 
</div> 
</div> 
<div id="splashfooter"> 
 
</div> 
</body> 
</html>
Random Solutions  
 
programming4us programming4us