i am working on an entry form and
i am trying to enable a particular set of selection options in the second option set depending on
the option i select in the first option set. how can i do it.here is a portion of the code i was trying but
it couldn't work please help.
[code=html]
<center>
<form method="post" action="">
<p>
<table width=50% bgcolor="#E5E5E 5">
<tr><td align="center">
<table width=30% bgcolor=#E5E5E5 >
<tr><td>
<b><FONT SIZE="2" FACE="verdana"> Category</FONT></b><td width=75%>
<select name="category" ><option value="pentry"> pentry</option><option value="electric " selected>electr ic</option><option value="plumb">p lumb</option><option value="paint">p aint</option><option value="welder"> welder</option><option value="bricks"> bricks</option></select></td></td></tr>
<?php
$selector='cate gory';
if($selector==" electric"){?>
<tr><td> <b><FONT SIZE="2" FACE="verdana"> method</FONT></b><td><select name="method">< option>door</option><option selected>lock</option><option> cup</option><option> furniture</option><option> plate</option></select></td></td></tr>
<?php }else{ ?>
<tr><td> <b><FONT SIZE="2" FACE="verdana"> method</FONT></b><td><select name="method">< option>bath</option><option selected>tape</option><option> pipe</option><option> chair</option><option> mat</option></select></td></td></tr>
<?php } ?>
<tr><td><b><FON T SIZE="2" FACE="verdana"> Description</FONT></b><td>
<textarea rows="5" cols="16" wrap="virtual" name="descripti on">
</textarea></td></td></tr>
<tr><td><b><FON T SIZE="2" FACE="verdana"> residence</FONT></b><td> <input type="text" name="location" ></td></td></tr>
<tr><td><b><FON T SIZE="2" FACE="verdana"> Date</FONT></b><td> <input type="text" name="datetime" ></td></td></tr>
<tr><td><b><FON T SIZE="2" FACE="verdana"> sender</FONT></b><td> <input type="text" name="reporter" ></td></td></tr>
<tr><td> <td><input type="submit" value="submit">                <input type="reset" value="Reset"></td></td></tr>
</table>
</td></tr>
</table>
</form>
</center>
[/code]
i am trying to enable a particular set of selection options in the second option set depending on
the option i select in the first option set. how can i do it.here is a portion of the code i was trying but
it couldn't work please help.
[code=html]
<center>
<form method="post" action="">
<p>
<table width=50% bgcolor="#E5E5E 5">
<tr><td align="center">
<table width=30% bgcolor=#E5E5E5 >
<tr><td>
<b><FONT SIZE="2" FACE="verdana"> Category</FONT></b><td width=75%>
<select name="category" ><option value="pentry"> pentry</option><option value="electric " selected>electr ic</option><option value="plumb">p lumb</option><option value="paint">p aint</option><option value="welder"> welder</option><option value="bricks"> bricks</option></select></td></td></tr>
<?php
$selector='cate gory';
if($selector==" electric"){?>
<tr><td> <b><FONT SIZE="2" FACE="verdana"> method</FONT></b><td><select name="method">< option>door</option><option selected>lock</option><option> cup</option><option> furniture</option><option> plate</option></select></td></td></tr>
<?php }else{ ?>
<tr><td> <b><FONT SIZE="2" FACE="verdana"> method</FONT></b><td><select name="method">< option>bath</option><option selected>tape</option><option> pipe</option><option> chair</option><option> mat</option></select></td></td></tr>
<?php } ?>
<tr><td><b><FON T SIZE="2" FACE="verdana"> Description</FONT></b><td>
<textarea rows="5" cols="16" wrap="virtual" name="descripti on">
</textarea></td></td></tr>
<tr><td><b><FON T SIZE="2" FACE="verdana"> residence</FONT></b><td> <input type="text" name="location" ></td></td></tr>
<tr><td><b><FON T SIZE="2" FACE="verdana"> Date</FONT></b><td> <input type="text" name="datetime" ></td></td></tr>
<tr><td><b><FON T SIZE="2" FACE="verdana"> sender</FONT></b><td> <input type="text" name="reporter" ></td></td></tr>
<tr><td> <td><input type="submit" value="submit">                <input type="reset" value="Reset"></td></td></tr>
</table>
</td></tr>
</table>
</form>
</center>
[/code]
Comment