SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard Darren884's Avatar
    Join Date
    Aug 2003
    Location
    Southern California, United States
    Posts
    1,616
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to open a custom window from a form?

    I want to open this:
    window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=0,width=600,height=500,left = 212,top = 134');

    and pass the data froma form to that when I hit the submit button but I don't know how. Can someone tell me plz... thanks.
    Have a good day.

  2. #2
    SitePoint Enthusiast BurakUeda's Avatar
    Join Date
    Apr 2005
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    H u m o
    Uncensored Forums for Intelligent People

  3. #3
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use the onsubmit event handler of the <form> tag to intercept the form before it is submitted. Then:

    1) Attach the data to the end of the url variable before calling window.open(), and then retrieve the data with code in the popup using location.search, or

    2) Capture the reference to the popup window that is returned by window.open(), e.g.:

    var popup = window.open(....);

    and subsequently create some global variables in the popup window and assign them the form values:


    var popup = window.open(....);
    popup["name"] = document.myForm.elements["name"].value;


Bookmarks

Posting Permissions

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