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. IE 6 and 8 problem

IE 6 and 8 problem

Scheduled Pinned Locked Moved Web Development
help
3 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.
  • L Offline
    L Offline
    Learner520
    wrote on last edited by
    #1

    Hi everybody, I have a CheckboxList on my web form and I have to display which check box have been ticked into List. the following code is working absolutely fine on IE 8 but not working on IE 6. I tried to change 'if' condition but failed to run same code on IE 6, main problem occurs in 'If' condition. thanks for any suggestion in adv. function readListControl() { var tableBody = document.getElementById('<%=cbsrc.clientId%>;').childNodes[0]; for (var i = 0; i < tableBody.childNodes.length; i++) { var currentTd = tableBody.childNodes[i].childNodes[0]; var listControl = currentTd.childNodes[0]; if (listControl.checked == true) alert('#' + i + ': is checked'); } } regards learner

    C A 2 Replies Last reply
    0
    • L Learner520

      Hi everybody, I have a CheckboxList on my web form and I have to display which check box have been ticked into List. the following code is working absolutely fine on IE 8 but not working on IE 6. I tried to change 'if' condition but failed to run same code on IE 6, main problem occurs in 'If' condition. thanks for any suggestion in adv. function readListControl() { var tableBody = document.getElementById('<%=cbsrc.clientId%>;').childNodes[0]; for (var i = 0; i < tableBody.childNodes.length; i++) { var currentTd = tableBody.childNodes[i].childNodes[0]; var listControl = currentTd.childNodes[0]; if (listControl.checked == true) alert('#' + i + ': is checked'); } } regards learner

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      This is bad code. It assumes a certain layout, and doesn't ever check if the object it is grabbing, exists. When you say it does not work, what is the problem ? Does it work in firefox ? Firebug helps you debug javascript. There are articles on CP about how to work with checked lists in javascript. Ideally you'd find a way to insert an id into each one so you could look up the elements by id instead of by array indices.

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      1 Reply Last reply
      0
      • L Learner520

        Hi everybody, I have a CheckboxList on my web form and I have to display which check box have been ticked into List. the following code is working absolutely fine on IE 8 but not working on IE 6. I tried to change 'if' condition but failed to run same code on IE 6, main problem occurs in 'If' condition. thanks for any suggestion in adv. function readListControl() { var tableBody = document.getElementById('<%=cbsrc.clientId%>;').childNodes[0]; for (var i = 0; i < tableBody.childNodes.length; i++) { var currentTd = tableBody.childNodes[i].childNodes[0]; var listControl = currentTd.childNodes[0]; if (listControl.checked == true) alert('#' + i + ': is checked'); } } regards learner

        A Offline
        A Offline
        April Fans
        wrote on last edited by
        #3

        if (listControl.tagName=='input' && listControl.type=='checkbox' && listControl.checked)

        April Comm100 - Leading Live Chat Software Provider

        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