• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 195
  • Last Modified:

onclick event with selects

Hi
I have a select and I want to use something like the click event in VB. The problem with onclick event is it fires off when the mousedown and mouseup events is fired on the control and to select an item it take 2 clicks. But then again a user might click the select and then click something else so counting the clicks wont work.

Anybody know what event/ideas to use?

Thnx
0
Veroland
Asked:
Veroland
  • 2
  • 2
1 Solution
 
knightEknightCommented:
Why does it take two clicks to select an item?  Can you show us a sample of the code you are using for the select?  Thanks
0
 
VerolandAuthor Commented:
<SCRIPT LANGUAGE="VBScript">
      Function cboMCat_onclick
            dim nMCat
            nMCat = document.DocData.cboMCat.options(document.DocData.cboMCat.selectedIndex).text
            
      End Function

</SCRIPT>

When press to open the select/dropdown it registeres as an onclick
0
 
knightEknightCommented:
You are trying to return the value of the selected item when something is clicked (presumably the select) ?  Is this correct?

The SELECT element also has an onChange event that you might try -- it is fired whenever a new item in the list is selected.
0
 
VerolandAuthor Commented:
AHA, you can see my boss have stuck on F#$##$ VB to much, didn't even look at onChange

Thnx
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now