Link to home
Start Free TrialLog in
Avatar of Coast Line
Coast LineFlag for Canada

asked on

Issue with Javascript Code

I have the following function which works in all browsers except in IE7 mode

I always check with developer tools and it shows error on the following function:

function inspectFields() {
		if (document.shippingForm.checkService != undefined) {	
			document.shippingForm.getElementById('checkService').checked = true;
		$j('#Addr').hide();
		
	}	
}

Open in new window


Display error on this line:

document.shippingForm.getElementById('checkService').checked = true;

object doesn't support this property

how will i write above in jquery to see if that fixes the issue

it is called as the following

addLoadEvent(inspectFields);

Open in new window

Avatar of Alexandre Simões
Alexandre Simões
Flag of Switzerland image

In the code I see: $j('#Addr').hide();

What's $j ? A syntax error or something else?

For me that line should normally be: $('#Addr').hide();
Avatar of Coast Line

ASKER

it is used for noconflict with other libraries
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I'm not sure that JS getElementById allows a double declaration such as document.shippingForm.getElementById('checkService')
Shouldn't it be simply document.getElementById('checkService')...?