Lassie Posted December 12, 2007 Share Posted December 12, 2007 As part of a page header I have a simple search input form. I aslo have an input form which submitts to itself for validation etc When I include the search for in the header the input form takes the search form action ie it goes to search .php If I comment the search form out the form submits to itself as required. How can I resolve this? search form <td class="tcart"><form action="search.php" method="get"> <input type="text" size="20" name="q" value=""/> <input type="submit" value="Search"/> </form</td> input form submit [code] <form action = 'checkout.php' method = 'post'> //input fields <input type ="hidden" name="submitted" Value="TRUE"/> <tr><td colspan = 2 align = 'center'> <b>Please press Purchase to confirm your purchase, or Continue Shopping to add or remove items</b> <?php display_form_button('purchase', 'Purchase These Items'); display_button('show_cart.php', 'continue-shopping','Continue Shopping'); ?> </td> </tr> </form> button function [code] function display_form_button($image, $alt) { echo "<center><input type = image src=\"images/$image".".gif\" alt=\"$alt\" border=0 height = 50 width = 135></center>"; } [/code] [/code] Link to comment https://forums.phpfreaks.com/topic/81339-form-problem/ Share on other sites More sharing options...
Stephen68 Posted December 12, 2007 Share Posted December 12, 2007 Not sure of this but you are only displaying a button in the second form, I guess when the search form is there and you hit the button it submits the first form. Maybe you should just add a submit button to your search form. Stephen Link to comment https://forums.phpfreaks.com/topic/81339-form-problem/#findComment-412824 Share on other sites More sharing options...
Lassie Posted December 12, 2007 Author Share Posted December 12, 2007 Thanks. I tried a submit button and same result.The page selected when the mouse is on the button is search.php Is it not possible to have 2 forms on a page? The button code added was <tr><td><input type="submit"name="submit" value="checkout"/></td></tr> Link to comment https://forums.phpfreaks.com/topic/81339-form-problem/#findComment-412915 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.