Forum Moderators: open
I am re-doing a web site for a client and he wants to have a form on his home page so that visitors can be added to a data base and receive an email newsletter.
Once the visitor enters their information and clicks "submit" they are redirected to a confirmation page that has a "back" button to return them to where they came from. With this site we want to have the confirmation page pop-up in a small separate window.
I have got this to work with Firefox beautifully but when I try the form in Internet Explorer the confirmation page does not pop-up but is displayed in the same window as the form.
I only know enough about Java to copy and paste and am at a loss as to how to get the form confirmation pop-up work in IE. I have tried everything I can think of (which admittedly is not much) to get it to work.
Can someone offer any suggestions please?
Thanks!
[edited by: DrDoc at 10:50 pm (utc) on Feb. 11, 2006]
[edit reason] Removed references. See TOS. [/edit]
Simply set the target attribute on your form to
_blank And, by the way: it is JavaScript, not Java. The two are very different and are not related (just like every Smith in the USA is not a relative of the other).
Sorry to be a simpleton but I'm not sure where to put the code you are suggesting. Here is the code from the form that works in Firefox but IE.
Would you tell me where I need to put the code to make it work in IE?
Thanks so much for your help.
<SCRIPT>
<!-- Privacy policy -->
function open_window(url) {
mywin = window.open(url,"win",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=250,height=280,left=262, top=144');
}
</SCRIPT>
<SCRIPT TYPE=" text/javascript" >
<!--
function popupform(myform, windowname)
{
if (! window.focus)return true;
window.open(' YOUR POPUP PAGE HERE' , windowname, ' height=420,width=628,scrollbars=no' );
myform.target=windowname;
return true;
}
//-->
</SCRIPT>
<form action="http://example.com/cgi-bin/formsubmit.cgi" name=" " onSubmit=" popupform(this, ' join' )" >
Name:<br>
<input name="Name" size="23"><br>
Email Address:<br>
<input type=text name="Email" value="" size="23"><br>
<input type=submit value="Submit">
<input type=hidden name="do" value="add_lead_external">
<input type=hidden name="Username" value="nlhc">
<input type=hidden name="Stop_Status" value="Active">
<input type=hidden name="Cycle_Number" value="0">
<input type=hidden name="Success_URL" value="http://example.com/success.htm">
<input type=hidden name="Failure_URL" value="http://example.com/failure.htm">
</form>
[edited by: DrDoc at 11:01 pm (utc) on Feb. 11, 2006]
[edit reason] Stripping out unnecessary code. Examplifying URLs. See TOS. [/edit]
<script type="text/javascript" >
function popupform(myform, windowname)
{
if (! window.focus)return true;
window.open('YOUR POPUP PAGE HERE' , windowname, 'height=420,width=628,scrollbars=no');
myform.target=windowname;
return true;
}
</script>
Change the
onsubmit in your opening form tag to: onsubmit="popupform(this, 'join')"