Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New Coder
    Join Date
    Oct 2005
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Popup window not working Please some help!

    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');" />
    Last edited by pkarovsky; 10-24-2005 at 12:09 AM. Reason: change title


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •