the following gives me an error in IE6.0 and 5.5, but not in IE5.0

I have statements like
where frm is my form's name and the error is:
ERROR: 'document.frm.realname' IS NULL OR NOT AN OBJECT.

so what's the correct way to refer to my form fields for those browsers?