I've created checkbox and added events to it through js file which is included in the jsp. It works fine in IE but not in Mozilla Firefox 1.5. This is the code fragments.

displayCheckbox.name = "Add_" +productid;
displayCheckbox.id ="Add_"+productid;

displayCheckbox.onclick = EventProducer.registerEventHandler(this, 'toggleSelected', [displayCheckbox, displayLI]);
displaySpan.onclick = EventProducer.registerEventHandler(this, 'clickCheckbox', [displayCheckbox]);
displaySpan.appendChild(displayCheckbox);

var displayA = document.createElement('a');
displayA.onclick = EventProducer.registerEventHandler(this, 'nop', []);
displayA.style.zIndex = Tree.BASE_Z_INDEX + 3;
displayA.className = itemLI.childA.className;
displayA.href = itemLI.childA.href;
displayA.innerHTML = itemLI.childA.innerHTML;
displaySpan.appendChild(displayA);

will you please any one look into that?

Shouldnt this be in the Javascript forum and not the Java forum? They are completely different languages.


FYI, appendChild function only works in some browsers in Windows, it does not work in Mac browsers except FireFox and maybe a couple others.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.