DropDownList
-
What I am trying to do is have a 5 dropdown lists that will each have a couple of entries. When an entry is selected from one of the lists it will have a integer value assigned to it. So if the second entry in a list is selected it might have a value of 10 assigned to it. When the entry from the dropdown is selected I need to have a textbox that will add up all the values from each of the dropdowns. A Little Overview: For each of my dropdowns I am using an Oracle database to get my values. I think I might have to use javascript but I dont know much about javascript. When I am using a asp dropdown list I can easiy add the items from the database into the ddl, but when I try to do an "onchange" of an ASP ddl I cant get my javascript to work, mainly because I dont know it very well. When I use a html box, i can do the onchange with javascript but I cant fill the box with items from my database. So.... If you know anything about calling javascript from an asp dropdown. or Inserting items into a html drop down box from a database. Please help me out, thanks a lot.
-
What I am trying to do is have a 5 dropdown lists that will each have a couple of entries. When an entry is selected from one of the lists it will have a integer value assigned to it. So if the second entry in a list is selected it might have a value of 10 assigned to it. When the entry from the dropdown is selected I need to have a textbox that will add up all the values from each of the dropdowns. A Little Overview: For each of my dropdowns I am using an Oracle database to get my values. I think I might have to use javascript but I dont know much about javascript. When I am using a asp dropdown list I can easiy add the items from the database into the ddl, but when I try to do an "onchange" of an ASP ddl I cant get my javascript to work, mainly because I dont know it very well. When I use a html box, i can do the onchange with javascript but I cant fill the box with items from my database. So.... If you know anything about calling javascript from an asp dropdown. or Inserting items into a html drop down box from a database. Please help me out, thanks a lot.
Assalam-O-Alaikum! Yes you can insert items into a html drop down list from a database. You have to write inline code for this. I am writing the code for SQL Server, you have to convert it into Oracle. <% Dim Obj_Con As New SQLConnection("ConnectionString") Obj_Con.Open() Dim Obj_Comd As New SQLCommand("Select * From TableName", Obj_Con) Dim Obj_DReader As SQLDataReader Obj_DReader = Obj_Comd.ExecuteReader() Do While Obj_DReader.Read %> <%=Obj_DReader("FieldName")%> <% Loop Obj_DReader.Close() Obj_Con.Close() %> This may solve your problem. Take care. Allah Hafiz