unselectable datacombo

O

oaksong

I've got a data combo with about 12 rows, of which only the first two
are selectable!

I put a label on the page below the datacombo and selecteditem.text
will populate the list when I change the selection combo for either of
the first two items, but not for any of the others.

I'm using database objects to populate the Datacombo.

The code is:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here

If Not IsPostBack Then
odaParam.Fill(DsParam2)
cmbParam.DataBind()
End If


End Sub

Private Sub cmbParam_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
cmbParam.SelectedIndexChanged

Label1.Text = cmbParam.SelectedItem.Text

End Sub

The HTML is:
<P>
<select name="cmbParam" onchange="__doPostBack('cmbParam','')"
language="javascript" id="cmbParam">
<option value="0"> Select..</option>
<option value="S">Body Location</option>
<option value="S">Evaluation</option>
<option value="S">Feature</option>
<option value="S">Period</option>
<option value="0">Primary Location</option>
<option value="0">Repetition</option>
<option value="0">Season</option>
<option value="S">Sensation</option>
<option value="0">Shave</option>
<option value="S">Site</option>
<option value="S">Skin Type</option>
<option value="0">Subject</option>
<option value="0">Tan</option>

</select></P>
 
B

Bruce Barker

a select posts back the selected value, not the index, so in your case it
eithe '0' or 'S', wich always matches one of the first two selections. you
need unique values for each selection.

-- bruce (sqlwork.com)
 
O

oaksong

Ok. I was missing the part about what was being posted back, but I
finally managed to finally figure that part out. I'm appending the Text
to the Value to get a unique. Not pretty, but gets me to where I want
to go.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top