Jump to content

form help


the-botman

Recommended Posts

i have this form now the problem is when i click search it searchs fine but if i just click  enter it still searchs but does not search with the value of the search button,  i am not sure what i am doing wrong when i input say love and i click search it gives me mysite.com/search.php?vq=love&s=published&submit=Search but if i dont click search and i just click enter i get mysite.com/search.php?vq=love&s=published  anyways this is my code thanks in advance

<form action="search.php" method="GET">
<div class="menu3">
      Search Keywords: <br/>
     
     <input type="text" name="vq" /><br />

      Order by: 
      <select name="s">
        <option value="viewCount">User views</option>
        <option value="ratin">User rating</option>
        <option value="published" selected="selected">Newest</option>
      </select>
      <br/>
    <input type="submit" name="submit" value="Search"/>    
</div> 
</form>]

Link to comment
Share on other sites

the botman is correct to use GET, this is not an issuse with the form as such, we need to see some code, have you coded it so that it only executes your search when the button is clicked?

Link to comment
Share on other sites

Assuming that you're using Internet Explorer (IE), this seems like a browser bug. The code works as expected in FireFox.

 

I've had a lot of problems with forms that only have one text input. IE usually doesn't pass any information. Since your form also has the drop-down menu, at least the form data is being passed.

 

If you add another text input to the form, you should see that the form will work just fine. Note that it doesn't seem to matter if the form is using the GET or POST method.

 

 

There are a few ways that you can get around this problem:

[*]add a second text input and hide it with CSS or

[*]add a hidden input field and use that to test if the form was submitted

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.