Cant get this search form to work the way I want it
What i wanted was a "search by category" option next to my search form. My question was, how would I get it to actually search by category? This has eaten about 4 hours and I know some of you could most likely fix this in less than 20 mins. Please help!
heres my search form (with the categories)
<br><form action='search.php' method='GET'>
<font face ='sans serif' size='5'>
<center>
<s开发者_开发技巧elect name='category'>
<option> </option>
<option value='20'>20</option>
<option value='30'>30</option>
<option value='40'>40</option>
</select><form action="search.php" method="GET">
<input type='text' size='70' name='search'>
<input type='image' value='search' src='images/tickmark.pg'></a><br>
</form>
You've got two <form>
tags, which is invalid. They cannot be nested within each other. As well, using <font>
and <center>
just shows you're stuck in Netscape 3.0 days. You've also go a dangling </a>
with no matching <a
> before it.
Try this:
<form action="search" method="get">
<div style="text-align: center">
<select name="category"
<option ...>
<option ...>
</select>
<input type="text" size="70" name="search">
<input type="image" value="search" src="images/tickmark.jpg">
</div>
</form>
精彩评论