Form Submit on created popup

Discussion in 'Javascript' started by paolomatador@libero.it, Jul 28, 2005.

  1. Guest

    Hello!
    I've a little problem.
    I've created a dynamic popup with the document.write method with a form
    in it to pass some variables I need.
    After the page is created I want to submit the form automatically, but
    I dont know how, doesn't works.

    Here's the code!

    var whandle =
    window.open("about:blank","pdf",",directories=no,menubar=no,scrollbars=yes,resizable=no,width="+(larghezzaschermo-100)+",height="+(altezzaschermo-100)+",top=50,left=50");
    whandle.document.writeln("<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0
    Transitional//EN'>");
    whandle.document.writeln("<HTML><HEAD><TITLE>RIEPILOGHI
    CONTABILI</TITLE>");
    StrMess += sepRecord;
    whandle.document.writeln("<BODY topmargin=0 leftmargin=0 rightmargin=0
    bottommargin=0>");
    whandle.document.writeln("<form name='miostr' action='creaxml.jsp'
    method='post' target='pdf'><input type='hidden' name='StrMess'
    value='"+StrMess+"'><input type='hidden' name='titolo'
    value='"+titolo+"'><input type='hidden' name='param'
    value='"+parent.parent.parametri+"'><input type='submit'></form>");
    whandle.document.writeln("</BODY>");
    whandle.document.writeln("</HTML>");
    whandle.document.writeln("<script type='text/javascript'>");
    whandle.document.writeln("document.miostr.submit();");
    whandle.document.writeln("</script>");

    I think the problem is that the page isn't still completed when try to
    submit the form, and something happens.

    Instead, if I specify the target of the form as _blank, everything goes
    well and the form submit.

    If I want to submit on the same page, doesnt works.
    Anyone knows how?
    Thanks in advance.
    Paolo.
     
    , Jul 28, 2005
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    6,653
  2. Neil
    Replies:
    6
    Views:
    40,907
    atilio123321
    Sep 2, 2011
  3. John Straumann

    Popup confirmation before ASP.NET Form Submit

    John Straumann, Oct 31, 2008, in forum: ASP .Net
    Replies:
    3
    Views:
    3,973
    sloan
    Nov 3, 2008
  4. Timothy Madden

    Submit a form and open a popup at once

    Timothy Madden, Apr 8, 2004, in forum: Javascript
    Replies:
    4
    Views:
    178
    Timothy Madden
    Apr 8, 2004
  5. Jens Peter Hansen
    Replies:
    7
    Views:
    868
    Randy Webb
    Jun 19, 2004
  6. Replies:
    2
    Views:
    557
  7. Replies:
    3
    Views:
    1,063
  8. V S Rawat

    How to submit a form in a popup window?

    V S Rawat, Aug 7, 2008, in forum: Javascript
    Replies:
    11
    Views:
    489
    Thomas 'PointedEars' Lahn
    Aug 10, 2008
Loading...