Recognise 1st entry in combobox
Hi all! Any suggestions on this one please?
Code:
<HTML>
<HEAD>
<SCRIPT Language="javascript">
function whatSelected()
{
alert(document.frmSample.cmbBox1.value);
}
</SCRIPT>
</HEAD>
<BODY>
<FORM Name="frmSample">
<SELECT Name="cmbBox1" Id="cmbBox1" onmouseup="whatSelected()">
<OPTION Value="1">1</OPTION>
<OPTION Value="2">2</OPTION>
<OPTION Value="3">3</OPTION>
<OPTION Value="4">4</OPTION>
<OPTION Value="5">5</OPTION>
</SELECT>
</FORM>
</BODY
</HTML>
If you look at this lil sample, it'll work if you select anything other than the first one (index 0 or option 1). I've tried onmouseup, onchange, selected property and can't for the life of me work out how to pick up the first entry.