Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Web Design, HTML And CSS Forums (http://www.go4expert.com/forums/web-design-forum/)
-   -   Multiple forms on one html page (http://www.go4expert.com/forums/multiple-forms-html-page-t11819/)

annemarie 4Jul2008 01:22

Multiple forms on one html page
 
We're having difficulties dealing with two forms on one html search results page. We want the following to happen:
1) "next" and "previous" links to appear when the search returns more results than the limit set in the code.
2) the user to be able to click on a link/radio button which would allow them to view complete result data on another page.

The code for goal 1 seems to need a "method = get" capability, while the second goal needs "method = post" to pass information on to the next page. We thought that the best way to do this would be to have two separate forms on the one html page. However, we can't seem to get either form to work in its entirety.

Here's the code for our form with the "next" and "previous" links:

Code:

<form name = "form2" id="form2" method="get" action="<?php echo $_SERVER['PHP_SELF']?>">
When there is only this form on the page, the next/previous links work fine. It's when we try to incorporate other buttons (such as a submit button) and another form that things get messy. The same is true for the other form... it works fine by itself, but it's the combination that throws it off.

Goal 2 form:


Code:

<form name = $formNum id = $formNum method=post action=seach_match_result.php target='_blank'>
(This form has a submit button at the end.)These forms are not nested, but totally separated in the code.

Are we on the right track, or is there a better way to accomplish this?

Thanks!
AM

XXxxImmortalxxXX 4Jul2008 14:49

Re: Multiple forms on one html page
 
im super tired right now and can hardly stay up and can hardly focus but what i see so far makes sense to me umm ill do a good detailed investigation on whats good and whats not on it in a couple of hours okay

annemarie 8Jul2008 01:38

Re: Multiple forms on one html page
 
We think we are not explaining the problem very well.
We are trying to produce a results page like the Google search results page. Individual results pages would be available by clicking on links on the main results page, for example: a user searches our database for people whose birthdays fall on a specific day, and the main results page displays the first name of each of these. When the user clicks on the first name another page would pop up containing contact information for that person. The main results page would also have next and previous buttons, for example if there were more than 10 results, they would be displayed on multiple pages.
We are having problems both sending information from the main results page to each of the individual result pages, as well as getting the next and previous buttons to work. When either of these two components are in separate test pages they work successfully, but not when on the same php page.
Thanks,
AM

annemarie 8Jul2008 20:28

Re: Multiple forms on one html page
 
Actually, we just got it to work! In case anyone is interested in the solution, we basically passed variables for the individual search pages via the GET method in the URL. For the next and previous buttons, we had to pass our MySQL query in the URL.


All times are GMT +5.5. The time now is 13:47.