Link to home
Start Free TrialLog in
Avatar of pamela rizk
pamela rizkFlag for Lebanon

asked on

REad dataset of a drop down list

hi

i have a drop down list filled from server side as below:
(where SelectStatusCbo is the drop down and lStatusDS is the dataset)
 With SelectStatusCbo
                            .DataSource = lStatusDS.Tables(0)
                            .DataTextField = "Status_DescE" '"P_cle_stat"
                            .DataValueField = "internalCode" '"p_stat_int"
                            .DataBind()
                        End With
the dataset contains teh below column :
Process1, Status_DescE and internalCode
nowin javascript i need to do  the below:
 $("#" + SelectStatusCbo.id).on("change", function () {
//need to read the dataset and appropriate column of teh datase how to dow it?
}
well i need to read the dataset of the drop down in javascript goto the selected index and read each column value how to do it?
Avatar of leakim971
leakim971
Flag of Guadeloupe image

what about replacing :
.DataValueField = "internalCode"
by :
.DataValueField = "internalCode" +  "|" + Process1

and use :
$("#" + SelectStatusCbo.id).on("change", function () {
 var arrPipe = $(this).val().split("|");
 var internalCode = arrPipe[0];
 var Process1 = arrPipe[1];
 var Status_DescE = $("option:selected", this).text();
});

Open in new window

Avatar of pamela rizk

ASKER

no this solution does not work for me because this user control is used in many other web forms so i cannot change the value field and split the result
 i want a way where i need to  read the dataset  of this drop down from javascript without changing the datavaluefield
It is not clear which part you need assistance with
 $("#" + SelectStatusCbo.id).on("change", function () {
//need to read the dataset and appropriate column of teh datase how to dow it?
}

Open in new window

Are you asking how to go back to the server at this point or do you already have the data locally?

What is going to happen in the change handler - what is it the code is meant to do?
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thank you
You welcome!