469,142 Members | 1,125 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,142 developers. It's quick & easy.

unselectable datacombo

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>

Nov 19 '05 #1
2 1322
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)

"oaksong" <oa*****@hotmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
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>

Nov 19 '05 #2
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.

Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by eye5600 | last post: by
reply views Thread by oaksong | last post: by
6 posts views Thread by R | last post: by
1 post views Thread by Garg | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.