PDA

View Full Version : Drop Down Select


bsxiong
09-10-2008, 05:27 PM
Hi all,

i want to have a drop down form like

<form>
<select name="one">
<option value="john"> John </option>
<option value="timmy"> Timmy </option>
<option value="kathy"> Kathy </option>
<option value="other"> other</option>
<span id="other" style="display: none;">you have selected other </span>
</select>
</form>


i want to be able to select on "Other" and it shows span id "others"

any idea?

bsxiong
09-10-2008, 06:39 PM
Nevermind


<html>

<script type="text/javascript">

function hello(){

if(document.testing.optionme.value == "others"){
alert("hello world");
}
}


</script>

<form name="testing">
<select name="optionme" onChange="javascript: hello();">
<option value="non">non</option>
<option value="others">others</option>
</select>
</form>

</html>