CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2001
    Location
    Turkey
    Posts
    47

    Question document.write problem, onSubmit function not called

    below code does not call doSubmit() function but POSTs the page.



    Whats wrong with that line?
    Any idea?
    Thanks
    Nazire
    ---------------------------
    function doInit()
    {
    var d=parent.workSpace.document;
    d.open();
    d.write("<html>\n");
    d.write("<STYLE type=\"text/css\">\n");
    d.write("body.eMxBody {background-color:#EEEEEE }\n");
    d.write("</STYLE>\n");
    d.write("<body class=\"eMxBody\">\n");
    d.write("<FORM name=\"cncExecSpliceForm\" id=\"cncExecSplice\" method=POST onSubmit=\"doSubmit()\" action=\"/wls/cncexec/cncExecServlet?action=Splice
    & param=cmplt\">\n")

    ......
    ......
    }

  2. #2
    Join Date
    Aug 2002
    Location
    Washington, USA
    Posts
    104
    How is the submit being invoked? If you submit the form in code:
    Code:
    document.form.submit();
    the onSubmit event does not fire.
    - Shawn
    MCP, VB6: Desktop Apps
    [ C# | VB | .NET | Java | VC++ | Perl | PHP | Javascript ]
    Unless otherwise stated, all sample code provided is UNTESTED.
    http://www.codemastershawn.com

  3. #3
    Join Date
    Jun 2001
    Location
    Turkey
    Posts
    47
    I did not understand where to put that line.

    in the d.write("....")?
    or where?

  4. #4
    Join Date
    Aug 2002
    Location
    Washington, USA
    Posts
    104
    I'm not telling you to put that line anywhere. I'm saying if you are submitting the form programatically - by issuing that command - then the onSubmit event will not be triggered.

    How is the form being submitted?
    - Shawn
    MCP, VB6: Desktop Apps
    [ C# | VB | .NET | Java | VC++ | Perl | PHP | Javascript ]
    Unless otherwise stated, all sample code provided is UNTESTED.
    http://www.codemastershawn.com

  5. #5
    Join Date
    Jun 2001
    Location
    Turkey
    Posts
    47
    That is right, it does not submit the form, and it was my original question hot to submit that from.

    One solution could be to implement two frames and write dynamic and static contents into appropriate frame. So, right now I am try'ng to understand how to create two frames within one frame dynamically in a jsp page.
    any idea, or comments?

  6. #6
    Join Date
    Aug 2002
    Location
    Washington, USA
    Posts
    104
    Originally posted by nazire
    That is right, it does not submit the form, and it was my original question hot to submit that from.
    I don't follow you. You want to know how to submit the form programatically (in the code - without user input)?
    One solution could be to implement two frames and write dynamic and static contents into appropriate frame.
    Frames don't have anything to do with posting forms.
    So, right now I am try'ng to understand how to create two frames within one frame dynamically in a jsp page.
    JSP? You were talking about Javascript in the original post. Are you trying to do this with Javascript or JSP?
    - Shawn
    MCP, VB6: Desktop Apps
    [ C# | VB | .NET | Java | VC++ | Perl | PHP | Javascript ]
    Unless otherwise stated, all sample code provided is UNTESTED.
    http://www.codemastershawn.com

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured