Re: Passing variable to a page in a frameset
| From: | Dan Shirah | Date: | Fri, 15 Aug 2008 16:32:38 +0000 |
| Subject: | Re: Passing variable to a page in a frameset | ||
| References: | 1 2 3 4 5 6 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-278156@lists.php.net to get a copy of this message | ||
>
> In the <head> of my page, I have this:
>
> <script type="text/javascript">
> function submitForm(var1,var2) {
> top.mainFrame.document.my_search.text1.value = var1;
> top.mainFrame.document.my_search.text2.value = var2;
> top.mainFrame.document.my_search.submit();
> document.search_form.submit();
> }
> </script>
>
> If I type in a word in the search box
> http://beta.menashalibrary.org/about and
> hit enter, it searches the catalog just fine, but then just replaces the
> current page with the search results. If I click on the SEARCH link with the
> javascript, it does nothing.
It looks like you haven't adapted the example I gave you to conform to your
page/form structure.
top.mainFrame.document.my_search.text1.value = var1;
The frame you are populating may not be named mainFrame
The form in your destination frame may not be named my_search
The input in you destination frame may not be text1
You have to modify these areas to suit your application and add or remove
more as needed.