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. getting control value from table cell with javascript

getting control value from table cell with javascript

Scheduled Pinned Locked Moved Web Development
javascripthelpquestion
5 Posts 3 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.
  • M Offline
    M Offline
    mnaveed
    wrote on last edited by
    #1

    hi i have genrate a table dynamically with javascript and each row contains a input textbox control with ID and i want to loop through and access the value of each textbox at button click. for (i; i < Table.rows.length; i++) { var oRow = Table.rows(i); ???????????? need control value here is there any way to get control here like oRow.Cells[0]....... } thanks for your help..

    Nav.

    B M 2 Replies Last reply
    0
    • M mnaveed

      hi i have genrate a table dynamically with javascript and each row contains a input textbox control with ID and i want to loop through and access the value of each textbox at button click. for (i; i < Table.rows.length; i++) { var oRow = Table.rows(i); ???????????? need control value here is there any way to get control here like oRow.Cells[0]....... } thanks for your help..

      Nav.

      B Offline
      B Offline
      Bradml
      wrote on last edited by
      #2

      could you post the code u used to generate the table here, so i can better understand how you application works.


      Brad Australian By contacting your lawyer you negate the right to sue me.

      M 1 Reply Last reply
      0
      • B Bradml

        could you post the code u used to generate the table here, so i can better understand how you application works.


        Brad Australian By contacting your lawyer you negate the right to sue me.

        M Offline
        M Offline
        mnaveed
        wrote on last edited by
        #3

        can you please let me know how i can get the value of a control which is in TD section of a table i can access the table with javascript and all its row but dont know how i can get control from cell. sorry cant post the code hope you not mind. thanks

        Nav.

        B 1 Reply Last reply
        0
        • M mnaveed

          can you please let me know how i can get the value of a control which is in TD section of a table i can access the table with javascript and all its row but dont know how i can get control from cell. sorry cant post the code hope you not mind. thanks

          Nav.

          B Offline
          B Offline
          Bradml
          wrote on last edited by
          #4

          Sorry one more question, is the Text box in a form? if so it is referenced like this: form_name.input_name.value


          Brad Australian By contacting your lawyer you negate the right to sue me.

          1 Reply Last reply
          0
          • M mnaveed

            hi i have genrate a table dynamically with javascript and each row contains a input textbox control with ID and i want to loop through and access the value of each textbox at button click. for (i; i < Table.rows.length; i++) { var oRow = Table.rows(i); ???????????? need control value here is there any way to get control here like oRow.Cells[0]....... } thanks for your help..

            Nav.

            M Offline
            M Offline
            Malcolm Smart
            wrote on last edited by
            #5

            From memory (from an old bit of code...)

            var numOfRows = Table.childNodes.length

            var myRow = Table.childNodes[0];//first row

            var numOfCells = myRow.childNodes.length;

            var myCell = myRow.childNodes[0]; //gives you first cell

            var numOfControlsInCell = myCell.childNodes.length;

            var myControl = myCell.childNodes[0]; //gives you the first control in the cell

            Regards Angel *********************************************

            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