Home All Groups Group Topic Archive Search About
Author
1 Nov 2005 8:16 PM
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>

Author
1 Nov 2005 8:46 PM
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)



Show quoteHide quote
"oaksong" <oaks***@hotmail.com> wrote in message
news:1130876186.991530.239980@g44g2000cwa.googlegroups.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>
>
Are all your drivers up to date? click for free checkup

Author
1 Nov 2005 8:55 PM
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.

Bookmark and Share