...

View Full Version : Popup window not working Please some help!



pkarovsky
10-22-2005, 02:19 AM
This is my script. I'm trying to create a popup window when the user clicks PREVIEW so s/he can see what s/he has entered in her/his form. Then if the info is correct the preview window is closed and the user clicks SEND.

But I'm getting an error message that an object is expected Line 11 Char 9

1 function setFormAttrib(oForm, action, target){
2 oForm.target = target;
3 oForm.action = action;
4 if (target=="_popup"){
5 oForm.onsubmit = function(){
6 return checkCheckBox(this) && createPopup(target);
7 }
8 }
9 else{
10 oForm.onsubmit = function(){
11 return checkCheckBox(this);
12 }
13 }
14 }
15
16 function createPopup(target){
17 var win = window.open("", target, "resizable=1, scrollbars=1, width=600, 18 height=700");
19 w.focus();
20 return true;
21 }
.........

<form action="sendmail.asp" method="post" target="_self" onsubmit="return checkCheckBox(this)">
...fields here...
<input type="submit" name="btnSend" value="Send" onclick="setFormAttrib(this.form, 'sendmail.asp', '_self');" />
<input type="submit" name="btnPreview" value="Preview" onclick="setFormAttrib(this.form, 'previewmail.asp', '_popup');" />



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum