Results 1 to 7 of 7

Thread: Getting a form result into a Iframe

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

    Question Getting a form result into a Iframe

    Hello all!!

    I have a form that gets information from an external server and i need the results to be displayed on a Iframe under my website. It may be in a Iframe or displayed on a another page in my website, here a bit of the code i have :

    <form action="http://external.server.feeder.htm" method="GET" name="f" id="f" >
    <input type="hidden" name="LPR" id="LPR" value=0>
    <input type="hidden" name="MPR" id="MPR" value=0>

    .
    .
    .
    .

    input type="submit" value="Search" class="button" name="submit" id="submit" target="results"></td>
    <td><input type="reset" value="Reset" class="button" name="limpar" id="limpar"></td>

    </form>

    I hope you can help me on this

    Kind Regards

    Aclips

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,162
    Thanks
    263
    Thanked 690 Times in 678 Posts

    Default

    <form target="framename">

    the target attribute works the same way as with links (<a target="...">).
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

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

    Default

    Quote Originally Posted by djr33 View Post
    <form target="framename">

    the target attribute works the same way as with links (<a target="...">).
    Hi DJR33, thanks for replying, i have done that but it is not showing on the iframe, its keeps opening a new page, here's the code i'm using:

    <form action="http://external.server.feeder.htm" method="GET" name="f" target="results" id="f" >
    <input type="hidden" name="LPR" id="LPR" value=0>
    <input type="hidden" name="MPR" id="MPR" value=0>
    .
    .
    .
    input type="submit" value="Search" class="button" name="submit" id="submit" target="results"></td>
    <td><input type="reset" value="Reset" class="button" name="limpar" id="limpar"></td>

    </form>

    "hidden" iframe, to post results:

    <iframe width="0" id=”results” name="results" height="0" border="0" frameborder="0" scrolling="auto" align="center" hspace="0" vspace=""></iframe>

    Regards

    Aclips

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,925
    Thanks
    43
    Thanked 3,190 Times in 3,154 Posts
    Blog Entries
    12

    Default

    There are a few things about the code as you describe it in your post that raise flags for me.

    • Don't use the target attribute in the submit button tag.
    • Running a page from another server in this manner might be a security violation, or be blocked by that server, or by its code from being 'en-framed'.
    • An iframe should be at least 1 by 1, not 0 by 0, as you have it.


    There could be other problems.
    - John
    ________________________

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

  5. #5
    Join Date
    Oct 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    There are a few things about the code as you describe it in your post that raise flags for me.

    • Don't use the target attribute in the submit button tag.
    • Running a page from another server in this manner might be a security violation, or be blocked by that server, or by its code from being 'en-framed'.
    • An iframe should be at least 1 by 1, not 0 by 0, as you have it.


    There could be other problems.
    Deleted the target fom submit
    The permision ofr getting the files form the external server is granted and has no 'en-framed'
    I have changed the Iframe for 1by1

    Still its not working

    I was thinking that the content page that the external server sends after the form is submited has an filled header, would that header get the ifram to simply not work properly?

    Or maybe the fact that the result html link returns in something like this:
    http://external.server.results.htm?L...&submit=Search

    What you think?

    Regards

    Aclips

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,925
    Thanks
    43
    Thanked 3,190 Times in 3,154 Posts
    Blog Entries
    12

    Default

    Without seeing the site, I can only guess. Oh, I already did that. Anyways, with a complex setup, seeing it might not help much either, but at least I would have a fighting chance.

    Having a query string on the URL shouldn't have any effect, unless it triggers yet another action on the part of the external server.

    As an experiment, make the iframe like 200 by 200, just to see if anything is showing up in it or not.
    - John
    ________________________

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

  7. #7
    Join Date
    Oct 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ok, the website is www.bestsilvercoast.com and the trouble is getting the result from the form of the quick search on the index page.
    Last edited by aclips; 10-24-2007 at 09:13 PM.

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
  •