SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Sep 2001
    Location
    San Francisco
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    posting to iframes

    Hello - I'd like to post some data to an iframe embedded in my document. The iframe contains a php page, which is scripted to pull up some records from a database depending on the variables posted to it.

    More specifically, there's a search engine to the left of my iframe and i want the search query to be posted to the php script inside the iframe.

    My question is - how do i post data into that frame without the browser taking me to the page inside the iframe. This may just be a basic HTML question - but I can't figure it out. I just want to pass the results to that page and have it fisplay inside the frame while keeping the browser still on the main page with the search engine. Can this be done?

    thanks

    ian
    signature

  2. #2
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi nobodaddy,

    Are you identifying the correct DOM?

    window.iframeName.document.src =

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still

  3. #3
    SitePoint Zealot
    Join Date
    Sep 2001
    Location
    San Francisco
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you - I have this in the form element:

    <form name = "searchform" method = post onSubmit = "window.res.document.src = index.php;">

    the Iframe is named 'res'

    I would like this to load the index page into the iframe - can;t quite get it to work - I've been searching for something similar on the web as an example - any ideas what I might be doing wrong? thanks again.

    ian
    signature

  4. #4
    SitePoint Guru
    Join Date
    Jan 2001
    Location
    Alkmaar, Netherlands
    Posts
    710
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <form name="searchform" method=POST action="index.php" TARGET="IFrameName">

  5. #5
    SitePoint Zealot
    Join Date
    Sep 2001
    Location
    San Francisco
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    alright! that worked perfectly - thanks!
    signature


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •