Forms controlling other frames

Posted on 2005-04-21
Last Modified: 2010-04-09
I have a web page which has 2 frames

in fact one is an iframe on a page.

On the main page there is a form and a submit button, can i make the submit button change the page in the iframe?
Question by:Matthew Tandy
    LVL 53

    Expert Comment


    <input type="submit" onclick="top.frames['nameofframe'].location.href='newpage.htm'">

    LVL 5

    Accepted Solution


    In the main page form tag write the target as iframe name and give the action filename.


    <form name="frm1" action="test.html" method="post" target="Ifrm">
     <input type="submit" name="submit" value="submit">
    <iframe src="test2.html" name="Ifrm">


    Hope this helps...

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
    Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
    In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
    The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

    759 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

    10 Experts available now in Live!

    Get 1:1 Help Now