request value from iframe

Posted on 2006-05-11
Last Modified: 2008-02-01

I have a main asp page and a submit button on it,

In the main page i also have an iframe, the iframe src is also another asp page which has a form with text inputs in it.

My question is how can i request the information located in the iframe form
when i click the submit button in the main page

thank you

Question by:regevli
    LVL 6

    Expert Comment

    (notice the action is the main page [main.asp] and the target is [parent])

    <form action="main.asp" name="passToParent" target="_parent">
    <input type="text" size="10" name="testVariable" value="">
    <input type="submit" value="Pass to Parent">
    LVL 6

    Accepted Solution

    I think I may have read your question wrong: you want the submit button in main page:

    Main Page:

    <script language="javascript"><!--
    function pullData(thisObj){
      var getValue =;
    <iframe src="page2.asp" name="inf" height="60" width="140"></iframe>

    <form name="mf">
     <input id="pv" type="text" readonly="readonly"><br>
     <input type="button" value="Get iframe value" onclick="pullData('pv');">      


    Form on page2.asp:

    <form name="ptp">
      <input type="text" size="10" name="tv" value="">


    Author Comment

    yes this is what im looking for but my pages are asp pages and in the main page i already have a submit button,
    so i need a way to collect the information from the form in the iframe using server side script.

    think of it like an order page , in the main page i have the order header and in the iframe i have the order lines,

    i need to store the order lines and the order headers in the database using the same submit button which is located in the main form.
    but at the moment i dont know how to collect the information from the form located inside the iframe

    do you have an idea how to do it ?
    LVL 7

    Expert Comment

    rockymagee's second is a correct answer. You need to call the values from the iframe like this
    Replace the <> with their corresponding values. Hope that helps.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
    Uploading files to the web server has become common part of almost any kind of web application. People use different technologies to solve this, but regardless of the technology used, it is always useful to have some kind of progress indicator shown…
    This video teaches users how to migrate an existing Wordpress website to a new domain.
    The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now