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. JavaScript
  4. get controls using name

get controls using name

Scheduled Pinned Locked Moved JavaScript
javascript
4 Posts 4 Posters 2 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.
  • I Offline
    I Offline
    i gr8
    wrote on last edited by
    #1

    Hi, I have Two tables in my page Table 1 having list for checkbox with name CHK1 Table 2 also having list of checkbox with same name CHK1 using javascript i want to get the checkboxs form table 1.

    S M J 3 Replies Last reply
    0
    • I i gr8

      Hi, I have Two tables in my page Table 1 having list for checkbox with name CHK1 Table 2 also having list of checkbox with same name CHK1 using javascript i want to get the checkboxs form table 1.

      S Offline
      S Offline
      Sunasara Imdadhusen
      wrote on last edited by
      #2

      You can get with providing id of table like your first table id is table1 Now you can get the check box inside the table1

      //this will return all the inputs inside the table1
      var ele = document.getElementById('table1').getElementByTagName('input')
      //you can filter out it using type
      for(var c=0;c < ele.length; c++){
      if(ele[c].type=='checkbox'){
      //do the code....
      }
      }

      Please do let me know, if you have any doubt. Please provide "Vote":thumbsup: if this would be helpful, and make "Accept Answer" if this would be correct answer.:rose: Thanks, Imdadhusen

      sunaSaRa Imdadhusen +91 99095 44184 +91 02767 284464

      modified on Thursday, October 28, 2010 9:16 AM

      1 Reply Last reply
      0
      • I i gr8

        Hi, I have Two tables in my page Table 1 having list for checkbox with name CHK1 Table 2 also having list of checkbox with same name CHK1 using javascript i want to get the checkboxs form table 1.

        M Offline
        M Offline
        moocr com
        wrote on last edited by
        #3

        I think you'd better change one list checkbox name. if not, you can do it like the above answer, but it's not very good, i improve it at below:

        //get all the checkbox of table 1
        var ele = document.getElementById("table1").getElementsByTagName("input");
        var size = ele.length;
        var boxs = [];
        var j=0;
        for(var i=0;i
        do you like more js or web skills? just click my blog! moocr.com :)

        1 Reply Last reply
        0
        • I i gr8

          Hi, I have Two tables in my page Table 1 having list for checkbox with name CHK1 Table 2 also having list of checkbox with same name CHK1 using javascript i want to get the checkboxs form table 1.

          J Offline
          J Offline
          jaypatel512
          wrote on last edited by
          #4

          you can use '#table1 input:[name = CHK1]' as your parameter, and it will search get the checkbox of first table only..

          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