This code will help you :
<html>
<head>
<script >
function generateList( )
{
var i;
for(i=document.drop_list.list.options.length-1;i>=0;i--)
{
document.drop_list.list.remove(i);
}
var temp=document.getElementById("numberList").value;
var val1=2*temp+2;
var val2=2*temp+3;
var optn = document.createElement("OPTION");
optn.text = val1;
optn.value = val1;
document.drop_list.list.options.add(optn);
var optn1 = document.createElement("OPTION");
optn1.text = val2;
optn1.value = val2;
document.drop_list.list.options.add(optn1);
}
</script>
</head>
<body>
<FORM name="drop_list" action="" method="POST" >
<select name="numberList" id="numberList" onchange="generateList();">
<option value="">Select Number</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<SELECT NAME="list">
</SELECT>
</form>
</body>
</html>
Regards
Anurag Walia
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en