www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Client-Side Development > JavaScript

    JavaScript JavaScript (not Java) Discussion and technical support, including AJAX and frameworks (JQuery, MooTools, Prototype...)

    Reply
     
    Thread Tools Rate Thread Display Modes
      #1  
    Old 01-02-2003, 06:54 AM
    ritukhetan ritukhetan is offline
    Registered User
     
    Join Date: Jan 2003
    Posts: 2
    Window.open for POST method

    Hello all,


    How can I have a new pop up opening up using window.open() while using POST method in an HTML form.

    Here is a sample function I have tried. Here I want to show the result of the program in the new pop up whose size and other attributes can be controlled by me. Using "_new" is not accepatable.

    function doscratch_mail(){
    fh = document.scratchpad;
    // fh.action= "/dgtlbin/scratch_mail";
    window.open("/dgtlbin/scratch_mail","scratch_mail","toolbar=0,status=0,scrollbars=1,location=0,width=490,height=415,resiza ble=0");
    //fh.target= "_new";
    fh.method = "POST";
    fh.submit();

    return false;
    }

    Hoping to get a quick response, as I desperately need a solution to this.

    Regards,
    Ritu
    Reply With Quote
      #2  
    Old 01-02-2003, 07:15 AM
    swon's Avatar
    swon swon is offline
    Registered User
     
    Join Date: Dec 2002
    Location: Switzerland
    Posts: 424
    It's easier to use the form tag instead of a function.

    <FORM name=form onsubmit="javascript:window.open('','fenster','width=400,height=500,scrollbars=yes')" action="YourActionFile.html" method="post" target="fenster">

    let me know if it's not what you want.
    __________________


    Swon
    Reply With Quote
      #3  
    Old 01-02-2003, 09:49 AM
    Charles's Avatar
    Charles Charles is offline
    JavaScript Banned
     
    Join Date: Nov 2002
    Location: Baltimore, Maryland
    Posts: 11,881
    Quote:
    Originally posted by swon
    <FORM name=form onsubmit="javascript:window.open('','fenster','width=400,height=500,scrollbars=yes')" action="YourActionFile.html" method="post" target="fenster">
    should be:

    <FORM name=form onsubmit="window.open('','fenster','width=400,height=500,scrollbars=yes')" action="YourActionFile.html" method="post" target="fenster">
    __________________
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web
    Reply With Quote
      #4  
    Old 04-25-2008, 03:45 PM
    hester1645 hester1645 is offline
    Registered User
     
    Join Date: Apr 2008
    Posts: 1
    javascript solution:
    function openWindowWithPost(url,name,keys,values)
    {
    var newWindow = window.open(url, name);
    if (!newWindow) return false;
    var html = "";
    html += "<html><head></head><body><form id='formid' method='post' action='" + url + "'>";
    if (keys && values && (keys.length == values.length))
    for (var i=0; i < keys.length; i++)
    html += "<input type='hidden' name='" + keys[i] + "' value='" + values[i] + "'/>";
    html += "</form><script type='text/javascript'>document.getElementById(\"formid\").submit()</script></body></html>";
    newWindow.document.write(html);
    return newWindow;
    }

    works in IE and firefox
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 01:15 PM.



    Acceptable Use Policy

    Internet.com
    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.