SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict Shockt's Avatar
    Join Date
    Jan 2005
    Location
    California
    Posts
    360
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Senting POST information

    I am having a bit of trouble with a page I am working on. I am using a service for real estate listings in my area so I must use a specific JavaScript function called by the click of a link. This link is used as the submit button for a form with two fields, property type and location. Now in order for their search function to work properly, the two field values must be sent via POST to their URL. I want to slap this page in an iframe and send the form POST to that iframe instead of the full page. Now thats not the tricky part. The tricky part is the search form is on every page of the website.. but the iframe is only on one page. Is there a way to send the POST information to the search page and then send that information to the iframe?

  2. #2
    SitePoint Addict Shockt's Avatar
    Join Date
    Jan 2005
    Location
    California
    Posts
    360
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Am I unclear? Or does no one have a solution?

  3. #3
    SitePoint Aficionado JVLB's Avatar
    Join Date
    Jan 2002
    Location
    N 44 56.537' W 123 3.683'
    Posts
    1,127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Perhaps the target attribute of the form would allow what you are trying to do. It allows the server's response to be targeted to a named frame or iframe.

  4. #4
    SitePoint Addict Shockt's Avatar
    Join Date
    Jan 2005
    Location
    California
    Posts
    360
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I need the target to be the frame/iframe of another page.

  5. #5
    SitePoint Addict Shockt's Avatar
    Join Date
    Jan 2005
    Location
    California
    Posts
    360
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually, to clarify, I need the POST data to be sent to another page, then that sent to a page within an iframe. So there are two URLs that would take the place of the action field of the form. Is it possible to send this POST data using JavaScript? Or imitate the submit button on the other page and send the POST data using PHP?

  6. #6
    SitePoint Aficionado JVLB's Avatar
    Join Date
    Jan 2002
    Location
    N 44 56.537' W 123 3.683'
    Posts
    1,127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    JavaScript handles data before the POST or GET stage, in its raw form. Once it is packaged as POST or GET, it is part of an HTTP request and unavailable to JavaScript (though GET data can be parsed from a URL).

    JavaScript cannot address a completely separate page, unless it is in a window that is a child or opener of the current window, or in a frame that is a parent or child of the current page. Also, the pages within the windows/frames must share the same domain to interact.


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
  •