Forum Moderators: open
Could anyone help?
Mark
If the search engine you want to control uses GET to process its query input then you could use JavaScript to do this.
You need to figure out the format of the URL that the search engine you are linking to uses when you submit a query.
For example, to search Google, the URL is:
[google.com...]
The following code displays an IFRAME and your own edit box, from which you can submit a query directly to Google, which then opens up in the IFRAME:
<script type='text/javascript'>function GoGoogle()
{
document.all.googleframe.src='http://www.google.com/search?q='+document.all.s.value;
}</script>
<iframe id='googleframe' width='400' height='200' src='http://www.google.com/'></iframe>
<br><br>
<input type='text' name='s'>
<input type='button' value='Search' onclick='javascript:GoGoogle();'>
Of course you don't need to use an edit box and button, but this code should give you the mechanics of what you need to do.
Hope this helps!
I think this is probably getting a bit too tricky for my little brain...certainly tried the above but no luck.
I'm pretty sure that I should be calling the search.htm page within my site from the form (search box) that I intend to have on every page. The difficulty is surely posting the info to the external site, then calling the search.htm page within my site with the results already there in the iframe.
I'm also sure that I need to give the iframe an ID or name in order to be able to carry out this order.
However, I then begin to lose track of what's going on! I thought HTML was supposed to be easy... :(