Jump to content

Form problem


Lassie

Recommended Posts

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.