Results 1 to 4 of 4

Thread: Submitting a form into iframe (SSI script)

  1. #1
    Join Date
    Apr 2007
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Submitting a form into iframe (SSI script)

    I got this to work before then accidentally deleted the file... it is possible but I forgot how!

    1) Script Title: Iframe SSI Script 2

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...iframessi2.htm

    3) Describe problem: I have a form, which looks like this:

    HTML Code:
    <form name="login" method="post" action="login.php?try=true">
    <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
    <tr>
    <td colspan="2"><span class="formtags">Username</span><br>
      <input name="username" type="text" id="username"></td>
    </tr>
    <tr>
    <td colspan="2"><span class="formtags">Password</span><br>
      <input name="password" type="password" id="password"></td>
    </tr>
    <tr>
    <td width="78"><input type="submit" name="Submit" value="Login"></td>
    </tr>
    </table>
    </form>
    It submits the login information and I want it to submit into the SSI iframe, as if it were a normal link (which DynamicDrive provided this code:
    HTML Code:
    <a href="javascript:loadintoIframe('myframe', 'external.htm')">Link</a>
    I have tried the following (to make it easier, I cut off the un-needed code):
    1.
    HTML Code:
    <form name="login" target="mainframe" method="post" action="login.php?try=true">
    2.
    HTML Code:
    <form name="login" target="mainframe" method="post" action="javascript:loadintoIframe('mainframe', 'login.php?try=true')">
    3.
    HTML Code:
    <form name="login" method="post" action="javascript:loadintoIframe('mainframe', 'login.php?try=true')">
    I would like to note that the following code:
    Code:
    <form name="login" method="post" action="javascript:loadintoIframe('mainframe', 'usersystem/login.php?try=true')">
    works but seems to clear all of the data.

    I also remember that what I did wasn't complex. Although I have tried putting the javascript in the target tag, it didn't work. If you can suggest how to make this work, I'll say wether I've tried it or not.

    I also remember changing the attributed "id" and "name" of the iframe tag. But I tried all combinations and no luck.

    Thanks for your time.

    Regards,
    CJ-REAL

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    There are probably various ways to do this. In the one that springs to my mind at the moment, the iframe should have a name. It can be the same as its id, so something like so:

    Code:
    <iframe id="mainframe" name="mainframe" . . . .
    Once you have that, this should work:

    Code:
    <form name="login" target="mainframe" method="post" action="login.php?try=true">
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    CJ-real (04-20-2008)

  4. #3
    Join Date
    Apr 2007
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Cool, thanks.

    I thought I tried this on number #1 of my list...

    Thanks for your time.

  5. #4
    Join Date
    Jan 2008
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    id="mainframe" name="mainframe" need the "name" tag

    i also tried all the above lol... once i added the name thing in it worked

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
  •