PDA

View Full Version : remove the select box


joonstar
04-23-2003, 11:46 PM
I've made two buttons of frequently searched word with help of this forum.

<Form action="SearchList.php" method="POST">

<select name=item>
<option value="0">total</option>
<option value="1">children</option>
<option value="2">female</option>
<option value="3">male</option>
</select>

<input type="submit" name=item value="toy">
<input type="submit" name=item value="book">

</Form>

If I click the "toy' button, all data that have the word "toy" will
be shown in the SearchList.php.

If I click the "book' button, all data that have the word "book" will
be shown in the SearchList.php.

Now, I like to remove the select box.
But if I remove the select box, the SearchList.php will show all data regardless of the data's having the word "toy" or "book".

So, I think there are two ways for removing the select box with keeping the function of the button .

The first way is make the select box invisible, then the option value automatically would be selected as "0" (total).


The second way is put a code that makes the option selected "0" into the submit button.

I don't kno how to do them.

Thanks in Advance

Spookster
04-24-2003, 12:02 AM
Well you can use a hidden input

<input type="hidden" name="item" value="0">
<input type="submit" name=item value="toy">
<input type="submit" name=item value="book">

Unless you have a question regarding PHP then I will have to move this topic to the HTML forum.

joonstar
04-24-2003, 12:11 AM
It works!


<FORM name=search action="SearchList.php" method="POST">

<input type="hidden" name="show" value="0">
<input type="submit" name="item" value="toy"><br>
<input type="submit" name="item" value="book"><br>

</FORM>

Spookster
04-24-2003, 02:11 AM
You're welcome. :thumbsup:

I will move this to the HTML forum though anyways.