www.webdeveloper.com
Results 1 to 5 of 5

Thread: linking text inputs

  1. #1
    Join Date
    Oct 2003
    Location
    Pensacola, Fl
    Posts
    149

    linking text inputs

    Hi...I was wondering of it's possible to link two text inputs...one on a parent window, the other in an iframe...and do this without having to do a form submit? Thanks for any suggestions okham -o-o;

  2. #2
    Join Date
    Oct 2003
    Location
    Andover, UK
    Posts
    947
    What do you mean by linking text inputs?

  3. #3
    Join Date
    Oct 2003
    Location
    Pensacola, Fl
    Posts
    149
    Well, basically all I'm wanting to do is use a text value from a form on the parent page in a text value on an iframe so I can use the value in my script functions on the iframe source. I've tried so many object references to get the parent page value to the iframe page, but haven't found one that does the job....any suggestion would be great

    okham -o-0-

  4. #4
    Join Date
    Oct 2003
    Location
    Andover, UK
    Posts
    947
    The parent doc can access vars set in the iframe by prefixing references with the name of the iframe. For example:

    Code for parent doc:
    Code:
    <html>
    <head>
    <script>
    function myfunc() {
    	alert(ifr.myvar);	
    }
    </script>
    </head>
    <body>
    <iframe name='ifr' width='600' height='300' src='temp2.htm'></iframe>
    </body>
    </html>
    Code for iframe doc:
    Code:
    <html>
    <head>
    <script>
    var myvar = "hi there!";
    </script>
    </head>
    <body>
    <a href="javascript:parent.myfunc();">click me</a>
    </body>
    </html>

  5. #5
    Join Date
    Oct 2003
    Location
    Pensacola, Fl
    Posts
    149
    Thanks Mitya, that script reference explains to me some things I was wondering about....calling a function on the parent page, for one.....thanks for the info.... okham -0-0-

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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



Recent Articles