submit form & open page with 1 button


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: submit form & open page with 1 button

Hybrid View

  1. #1
    Gregg Guest

    submit form & open page with 1 button


    Hello,
    I would like to submit the contents of a form by clicking
    on a "submit" button and then have another page open.
    The idea is that I want to gather information about the
    people who are opening a particular page by forcing
    them to first fill out a form. I tried using the standard
    html "submit' function and then java script to open the page,
    and the page would open, but the form info would not be sent.
    I assume I need to do both the submit and page open in Java
    script but don't know how. Can you please help?

    Thanks in advance,
    Gregg

  2. #2
    Justin T. Normann - Guest

    Re: submit form & open page with 1 button


    "Gregg" <extension@wec.ufl.edu> wrote:
    >
    >Hello,
    >I would like to submit the contents of a form by clicking
    >on a "submit" button and then have another page open.
    >The idea is that I want to gather information about the
    >people who are opening a particular page by forcing
    >them to first fill out a form. I tried using the standard
    >html "submit' function and then java script to open the page,
    >and the page would open, but the form info would not be sent.
    >I assume I need to do both the submit and page open in Java
    >script but don't know how. Can you please help?
    >
    >Thanks in advance,
    >Gregg


    Hi Gregg!
    You must define your button not as a Submit button. You have to define in
    html following:

    <input type="BUTTON" value="Submit it!" onClick="performProcess();">

    And in your Javascript part you will need following lines:

    <SCRIPT LANGUAGE="JavaScript">

    var OpenWindow;
    var windowprops = "toolbar=0,location=0,directories=0,status=0, " + "menubar=0,scrollbars=0,resizable=0,width=800,height=600";

    function performProcess() {
    OpenWindow = window.open("nameOfyourPage.html", "nameOfPage", windowprops);
    document.yourFormName.submit();
    }

    </SCRIPT>


    that should works. If I have understood your intention.

    Bye.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center