Need help with a JS bug

Im styling radioboxes with CIRC when I run the script locally I get not error at all…

but when I apply the script to my code on my webserver the radioboxes stops workings and I get this error in firebug

arrInputs[i].getAttributeNode(“type”) is null
[Break on this error] inputElementType = arrInputs[i].getAttributeNode(‘type’).value;

http://www.micr0softs.com/cf/

anyone would have an idea what could cause the script to bork when on my web server?

Thanks a lot

The name is just a string, there is no value properly on the name.

Still bugged out this part of the script is the problem to be EXACT

	arrsInputs = document.getElementsByTagName("input");
	
		// uncheck (label class) all radios in the same group
		for (var i=0; i<arrsInputs.length; i++) {	
			inputElementType = inputElement.getAttributeNode('type').value;
			if (inputElementType == 'radio') {
		
				inputElementName = arrsInputs[i].getAttribute('Name').value;
				inputElementClass = arrsInputs[i].className;
				// find radio buttons with the same 'name' as the one we've changed and have a class of chkHidden
				// and then set them to unchecked
				if (inputElementName == clickedInputElementName && inputElementClass == 'crirHidden') {				
					inputElementID = arrsInputs[i].getAttributeNode('id').value;
					labelElement = crir.findLabel(inputElementID);
					labelElement.className = 'radio_unchecked';
				}
			}
		}
		inputElementName = arrsInputs[i].getAttribute('Name').value;

This is where everything goes wrong
the array
arrsInputs = document.getElementsByTagName(“input”);
arrsInputs.length return a number of 65 inputs wich is correct for my page
then
if (inputElementType == ‘radio’) {
is getting excuted properly its when im trying to retreive the name of this input with

inputElementName = arrsInputs[i].getAttribute('Name').value;

its as if arrsInputs[i] is empty and no name is set I also tried to
inputName = arrsInputs[i]

then use
inputName.getAttribute(‘Name’).value;
no result :S

The code if half working now the html output version on

http://www.micr0softs.com/cf/index.html

but not working on the php version… wich is weird since its the same exact code… -___-

thanks both for replies I will check the hints and get back to you guys on that :slight_smile:

Two things that I see that might be doing it.

Not all of the attribute values are inside of quotes.
Not every input has a type attribute.

Sometimes when uploading content to remote servers the content can be cached…check the source and compare it to your working copy to make sure it hasn’t cached the files.

Other than that, i’ve checked the site in IE7 and am getting a different error:

Message: ‘clickedLabelElement’ is null or not an object
Line: 113
Char: 4
Code: 0
URI: http://www.micr0softs.com/cf/crir/crir.js