Hi All,

How can we set a value to iframe textbox element either in JS/Jquery

<head>
        <script type="text/javascript">
            function load()
            {
            alert("Frame is loaded");
            myframe.document.getElementById("user_email").value = "<?php echo $var ?>";
            }
        </script>
    </head>
    <body>
        <iframe onload="load()" id="myframe" name="myframe" src="http://www.gigpayrr.com/signup" width="700px" height="600px">
          <p>Your browser does not support iframes.</p>
        </iframe>
    </body>

Recommended Answers

All 2 Replies

I would probably just pass it as a query string parameter for the page in the iframe tag.

<iframe onload="load()" id="myframe" name="myframe" src="http://www.gigpayrr.com/signup?user_email=<?php echo $var ?>" width="700px" height="600px">

Then you could use $_GET['user_email'] on the page in the iframe to get the value.

Thanks it worked...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.