Re: Passing variable to a page in a frameset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>
> I apologize for my ignorance, I don't really know much about
> javascript. When I add all that into my form page, when I submit the
> form, it just replaces the page I was on with the form results, rather
> than in the new frame page. I'm assuming I need to put the url for the
> frameset page in that code somewhere. Where does it go? And, which
> part do I replace with the frame name on that frameset page?
>
> Thank you for taking the time to help me with this, I really appreciate it!



Let's look at the code:

//var1 and var2 are the search criteria the user entered in your search
form(You may have more or less)
function submitForm(var1,var2) {

//top.leftFrame is how you set the focus to the frame you want.  leftFrame
could be different on your system...whatever you named the frame.

//top.leftFrame.document.my_search.text1.value=var1 assumes the form name in
the frame you want data in is named
//my_search and it givs the text object text1 the value of var1 from your
search form
top.leftFrame.document.my_search.text1.value = var1;

//top.leftFrame.document.my_search.text2.value=var2 assumes the form name in
the frame you want data in is named
//my_search and it givs the text object text1 the value of var2 from your
search form
 top.leftFrame.document.my_search.text2.value = var2;

//top.leftFrame.document.my_search.submit() will submit the form in your
target frame then you can use the $_POST values throughout the frame
 top.leftFrame.document.my_search.submit();

//document.search_form.submit() will submit your search page. I use this so
I can reuse the $_POST values to display the search criteria after submit.
 document.search_form.submit();
}

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux