Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. DropDownList

DropDownList

Scheduled Pinned Locked Moved ASP.NET
javascripthtmldatabaseoraclehelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tridith
    wrote on last edited by
    #1

    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.

    N 1 Reply Last reply
    0
    • T Tridith

      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.

      N Offline
      N Offline
      naveedmazhar
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups