I am trying to have a form submit open a new window (of fixed size) to show the results of the form selection.
I have partial success but some odd results too.
My code is as follows;
The initial html page has a javascript function;
function popWin() {
if (document.MM_returnValue == "") {
LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;
settings='width=300,height=300,top='+TopPosition+',left='+LeftPosition+',scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
FormResults=window.open("","FormResults",settings);
}
}
The form has;
<form name="newsletter" method="post" action="sqlregister.php" target="FormResults">
and the submit button;
<input type="submit" name="Submit" value="Subscribe" onClick="MM_validateForm('email','','RisEmail');return document.MM_returnValue;popWin()">
The MM_validateForm is Dreamweaver form validation which I test in popWin and don't pop the window if the form does not validate. That works OK.
The sqlregister.php does some testing to see if the person exists and sends emails to me and to the person registering then finishes the <php> and has normal which I want to be in a small dialogue type window with a close button.
What happens is;
(a) the new window opens but not to the sizes specified in popWin
(b) three emails get sent, the last one being from Nobody [nobody@box2.nameserver.net.nz]
box2.nameserver.net.nz is the host machine name.
Any ideas?