Pass variable window pop up javascript

Discussion in 'Javascript' started by shookim@gmail.com, Feb 23, 2006.

  1. Guest

    I've been looking all day for some code examples of how to pass a
    variable throught a javascript pop up window. There's nothing decent
    out there on the web...so after hours and hours of searching, I've
    finally figured out how to do complete the code for passing a variable
    to a window pop up and back.

    (Main window)

    create a window.open() function in your event, mine happens to be a
    "Find" button.

    <img src="images/Find1.gif" height=21
    onclick="Javascript:window.open('Test6.asp?txtManagerName='+document.getElementById('txtManagers').value,
    'wroxwindow', 'height=200, width=300, top=250, left=350, resizable=yes,
    scrollable=yes, toolbar=no');">

    the major problem I had was the exact syntax for passing the variable:

    Test6.asp?txtManagerName='+document.getElementById('txtManagers').value

    (you can name the value, doesn't have to be:
    document.getElementById('txtManagers').value
    could be...txtManagers, or whatever your variable being passed is.



    (Pop up window)

    Use a querystring command (vbscript)

    <%
    test = Request.QueryString("txtManagerName")
    Response.Write "test = " & test
    %>

    That's it...

    sk
    , Feb 23, 2006
    #1
    1. Advertising

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. =?Utf-8?B?RXZlcnNvbiBMaXJh?=

    Variable from a Pop Up Window

    =?Utf-8?B?RXZlcnNvbiBMaXJh?=, Oct 13, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    2,276
    =?Utf-8?B?Q3VydF9DIFtNVlBd?=
    Oct 13, 2005
  2. Shiperton Henethe
    Replies:
    17
    Views:
    5,356
    Deirdre Saoirse Moen
    May 21, 2004
  3. J P Singh
    Replies:
    3
    Views:
    288
    Howard Rothenburg
    Feb 11, 2004
  4. Madame Blablavatsky
    Replies:
    8
    Views:
    156
    Dr John Stockton
    Sep 16, 2005
  5. carrajo
    Replies:
    2
    Views:
    122
    scripts.contact
    May 21, 2007
Loading...

Share This Page