PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

Frame target not working

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Frame target not working

    I am not sure what I am missing, but I am trying to get the search results to appear in a div within my page. I am using the "target=_frameid" code, but it still opens the search in a new window. Here is the code I am using:

    for the form:

    <div class="searcharea" id="searcharea" style="position: absolute; left: 500px; top: 62px; width: 237px; height: 116px">
    <form action="search.html" method="GET" target="_MAIN">
    <input type="text" name="zoom_query" size="20" target="_main"> <input type="submit" value="Search" id="button" >
    </form> </div>


    for the frame:

    <div id="main">
    <iframe id="MAIN" src="#" scrolling="no" frameborder="0"> </iframe>
    </div>


    This is all within the same page. I am using Javascript for the search function.

    Thanks!

  • #2
    Not having worked with Frames before, but don't the names have to be identical?

    target="_MAIN"
    id="MAIN"

    ??

    Comment


    • #3
      well, i have tried both target="main" and target="_main". I assumed that "_main" was necessary since target="_blank" produces a blank window.
      anybody else know what i am doing wrong?

      Comment


      • #4
        No, the target name definitely needs to match the frame name. "_blank" is an exception, it is a special keyword for a new window.

        The <div> part in your frame code should not be necessary. The name in your frame should use the "name=" attribute as opposed to the id= attribute. So, maybe something like this:

        <iframe name="MAIN" src="#" scrolling="no" frameborder="0"></iframe>

        Failing that, perhaps you can give us the URL to your page and we might be able to spot the problem easier.

        You should also consult the many web resources out there on using frames and iframes. For example:
        http://www.w3.org/TR/REC-html40/present/frames.html
        --Ray
        Wrensoft Web Software
        Sydney, Australia
        Zoom Search Engine

        Comment

        Working...
        X