in this list menu, i called it status... i have two options....
-Regular employee
-part-time...
so when i click on the regular employee, i should show a textfield.... but if i click on the part-time.... it should show nothing...
im really new to javascript... so i dont know much about it... but i tried to... and i come up with this code... and its not working...
Html
<td>Status: </td> <td><select name="status" id="status" onchange="onselectedstatus"> <option>Please select a status</option> <option <?php if(($_POST['status']) == "Regular Employee") echo "selected='selected'";?> >Regular Employee</option> <option <?php if(($_POST['status']) == "Part-time") echo "selected='selected'";?> >Part-time</option> </select></td>
Javascript
function onselectedstatus() { if (document.getElementById('status').value == "Regular Employee"){ //show the textfield here, which is im discovering since i dont know how to yet... } }
ANY HELP WILL BE APPRECIATED...