Forum Moderators: open
<select name="month" onchange="put_m()">
<option>January</option>
<option>February</option>
<option>March</option>
<option>April</option>
<option>May</option>
<option>June</option>
<option>July</option>
<option>August</option>
<option>September</option>
<option>October</option>
<option>November</option>
<option>December</option>
</select>
is there an easy way, so the dropdown list will not return the name of the month when using this function
function put_m()
{
option=document.forms[0].month.options[document.forms[0].month.selectedIndex].text
m=option
}
but instead returning the number of the month (e.g. for april it should return "04")
thanks in advance
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Opt Demo 04.12.04</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
<!--
function showSel(){
al_txt=document.f_one.s_one.value;
alert(al_txt);
}
//-->
</script>
</head>
<body>
<form name="f_one">
<select name="s_one">
<option value="01">One</option>
<option value="02">Two</option>
<option value="03">Three</option>
</select>
<button onclick="showSel();">show it</button>
</form>
</body>
</html>