iframe asp

Once the btnsubmit is clicked, I want to carry txtabc.value to outsidetextbox
and make outsidediv = inline. Is it possible? If yes, please show me how.

Thanks,


<iframe>
<input name="txtabc" value=1">
<input type=submit name=btnsubmit>
</iframe>
<div id=outsidediv style="display:none">
<input name="outsidetextbox">
</div>
Webboy2008Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

baretreeCommented:
just a simple approach would be to have this (the iframe needs the "src" property and you need to use a form to submit, so):


you have an ASP called "theIframe.asp" that is the one to show within your other ASP's iFrame. This ASP has a form that will submit, taking the content of your control and displaying it on the other ASP's text control.

<html>
    <head>
        <title>theAsp</title>
        <script type="text/javascript">
            function fncSubmit() {
                try {
                    var valueToCopy = document.getElementById("txtabc").value;
                    var targetObject = window.parent.document.getElementById("outsidetextbox");
                    targetObject.value = valueToCopy;
                    targetObject = window.parent.document.getElementById("outsidediv");
                    targetObject.style.visibility = "visible";
                } catch (err) {
                    var txt = "error: ";
                    txt = txt + err.description;
                    alert(txt);
                } 
            }
	    </script>
    </head>
    <body>
        <form onsubmit="fncSubmit();">
            <label>text iframe</label>
            <input id="txtabc" type="text" value="1">
            <input type="submit" id="btnsubmit" value="submit">
        </form>
    </body>
</html>


This is the another ASP "theAsp.asp" that is the one that calls the iFrame and displays the text once submitted

<html>
    <head>
        <title>yourIframeASP</title>
    </head>
    <body>
        <iframe id="theIframe" frameborder="1" src="theIframe.asp"></iframe>
        <div id="outsidediv" style="visibility:hidden">
            <label>text outsideiframe</label>
            <input type= "text" id="outsidetextbox">
        </div>
    </body>
</html>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.