SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Mar 2004
    Location
    united states
    Posts
    178
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    targetting a form to an iframe

    Hello

    I am trying to use remote scripting in my page and I ran into several problems.
    My page is defined like so:
    Code:
    <html>
      <body>
        <form name="myForm" method="post" action="target.html" enctype="multipart/form-data" target="RSIFrame">
          <input type="text" name="text"></input>
          <input type="file" name="file"></input>
          <input type="submit" value="submit"> </input>
        </form>
        <iframe id="RSIFrame" name="RSIFrame" style="width:0xp; height:0px; border:0px;"></iframe>
         Text
      </body>
    </html>
    taget.html is defined like so:
    Code:
    <html>
      <head>
        <script type="text/javascript">
          <!--
          function processData() {
            window.parent.alert("back");
          }
          // -->
        </script>
      </head>
      <body onload="processData"></body>
    </html>
    I am trying to cause the form to be submitted via the "hidden iframe". Once a response will return from the server in taget.html, a message should be displayed in the original window.

    I have 2 problems:
    1) The iframe is indeeded hidden, but still takes a space in the original window (note the 'Text' being displayed right after it). I would like to make it completely invisible. I heard that if I gave it the style: display:none, it will not work properly.
    2) For some reason I am not getting the alert message to appear. I am not sure what the problem is. Maybe the form is not being submitted, or maybe the onload event is not triggered in target.html

    please help

  2. #2
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    [ already answered / other board ]
    ::: certified wild guess :::


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
  •