Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding Index

Status
Not open for further replies.

nareshreporter

Programmer
Mar 3, 2005
13
0
0
US
Hi,
I am trying to retrieve index of a selected item in a dropdownlist (default values) in CSP. I tried using FindIndexOf, but didnt work. Basicaly I have a dropdownlist that has default values. When the user selects any item from the DDL it displays that item in a listbox, which is current values. Now i want to get the index of the item that user selected in default values ie., from DDL. can anyone tell me how to get index. I appreciate your time.

Thanks in advance
 
I don't think this is a csp question, per se, but html. You are presumably doing something like this:
Code:
<select name='menu'>
<option value='val1'>A
<option value='val2'>B
<option value='val3'>C
This will display a droplist with the choices A, B, and C. After the user makes a choice, the form field 'menu' will hav the value associated with the choice: For A, 'val1'; for B, 'val2'; for C, 'val3'. I am not aware of a way to find the index of 'val1', 'val2', 'val3', unless they were stored independently in an array. But I could just be ignorant. You may want to take the question to an html forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top