Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Banned
    Join Date
    Jan 2007
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Sending a variable to another page

    Hello,

    I have a little problem here. Im trying t send a variable from one document to the other. Its like this.

    I have a page with a input textfield and a button that opens a new window.

    In the new window there is another button. When this button is pushed I want a variable for instance 10 To be send and displayed in the Input textfield of the previous window (USING JAVASCRIPT).

    Could anyone help me out a bit? This is a little experiment of mine, if I manage to get this done, this will open up many new possibilities for me!

    Thank you in advance,

    Donny

  • #2
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    You mean the opener of the popup gets a value?

    For most field types, this would work.
    opener.document.yourformname.yourfieldname.value=yourvariable;

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #3
    New Coder
    Join Date
    Sep 2006
    Location
    Toronto
    Posts
    19
    Thanks
    2
    Thanked 0 Times in 0 Posts
    I apologize that I'm not completely aware of how this works, or even if it can be done in javascript, but you could try putting it in the url, like so:
    http://www.website.com/webpage.js?value=variable
    var currentTime = new Date()
    var chance = currentTime.getTime()
    var chance2 = chance % 3
    alert(chance2)


  •  

    Posting Permissions

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