|
-
Feb 22nd, 2002, 07:36 AM
#1
Thread Starter
Evil Genius
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|