Forum Moderators: open

Message Too Old, No Replies

Post form results to an iFrame

post form to iframe

         

nickc

4:33 pm on Feb 27, 2004 (gmt 0)

10+ Year Member



I have a search form that returns results from a third party server. At present I show the results in a new window, but I'd really like to display them in an iFrame ona different page (to the form) on my site.

Any ideas on a jscript form handler to do this? I think I need to create a middle step to create the search string URL and then make that the src for the iFrame... somehow.

Thanks! nick

DrDoc

5:37 pm on Feb 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to Webmaster World!

If I were you, I would ditch the JavaScript approach. Submit the form to a Perl/PHP/ASP script and let that script build the page with the iframe. That's the best approach, by far.

john_k

10:24 pm on Mar 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Give the IFRAME a name, then use the target attribute of the form tag to indicate that is where the returned document goes.

nickc

1:47 am on Mar 5, 2004 (gmt 0)

10+ Year Member



Thanks John & Dr
Because I need the form results to show on a different page (on my site - but served from another site), just setting the target attribute won't work.

I'm pretty sure that I need to generate a new page that gets the url string generated by the form and posts it to the search engine. The iFrame is set to load that page with a redirect from the orginal form taking the user to the page displaying the iFrame.

If any of this makes sense then I am still looking for a javascript to do this.

Cheers, nick