Client-side JavaScript weirdness with assigning a form element - in Windows / IE6 only. Any ideas?



I have this snippet of client side code running:

var makeField = document.forms[0][makeFieldName];

alert("makeFieldName name,length,type=" + makeFieldName + ", " +
makeField.name + "," + makeField.length + "," + makeField.type);


The alert is just in there for debugging.

The function containing this code is called when a select field option is
changed. makeFieldName is the name of the select field in the form.

It works correctly from:

OS X / Safari
OS X / IE
OS X / Firefox
Windows / Firefox

but doesn't work right in Windows / IE6.

The diagnostic alert that shows up from all the browsers except Windows /
IE6 is the same:

makeFieldName name,length,type=1_onlyCarMake, 1_onlyCarMake,63,select-one

In other words, the makeFieldName is correct (1_onlyCarMake), and is the
same as makeField.name. The correct field is found and it has the right
number of options and the correct type for a select field.

But in Windows / IE6 only the diagnostic alert shows up with:

makeFieldName name,length,type=1_onlyCarMake, startWith,undefined,hidden

The startWith field happens to be the first field in that form (the only
form in the document, by the way) and it is, in fact, a hidden field. Thus
it makes sense that the length shown is undefined, since it is not a select
field and thus has no options array.

The problem is - why is Windows /IE6 incorrectly returning that field as a
result of the expression "document.forms[0][makeFieldName]" when all the
other browsers are returning the correct field?

It doesn't make any different whether I use document.forms[0][makeFieldName]
or actually specify the name of the form, as in
document["thisFormName"][makeFieldName]. In either case it works everywhere
but in Windows / IE6.

Anybody have any idea why the client is confused and returning the first
form element rather than the named one?

Thanks!

doug


.



Relevant Pages

  • Re: Apples poor positioning for the age *after* x86
    ... You might argue that Google is solving the wrong ... >> an alert the first time a new or modified app was run. ... > I do not see that Mac OS X uses alerts any the less than Windows, ... Windows also seems to have a three-tiered system for drivers. ...
    (comp.sys.mac.advocacy)
  • Re: Password saves not working with IE6 installed on a XP Professional
    ... but sfc found no errors and none of our workstations have this DLL. ... IE6 was produced after this restriction was dropped ... symptom that re-registering rsabase.dll was supposed to. ... by using Internet Explorer in Windows XP ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: virus help
    ... Yes we all could David lol.btw David have you tried the new beta ... with the Trojanized MBR which I can check in DOS now as well. ... out that KAVDOS32 does alert in plain DOS but not in Windows (I'm ... in Multi-AV alert. ...
    (alt.comp.anti-virus)
  • Re: Sudden alert
    ... the time I had done before with no problems) when a critical alert ... came up stating that some components of firefox were being blocked ... but with windows firewall stopping nero showtime from accessing the ... notified if any extentions are trying to install themselves (although ...
    (microsoft.public.windowsxp.general)
  • Re: virus help
    ... | with the Trojanized MBR which I can check in DOS now as well. ... | out that KAVDOS32 does alert in plain DOS but not in Windows (I'm ... | in Multi-AV alert. ... KAVClean.bat file used when scanning after booting with a DOS Boot Disk or a DOS Boot Disk ...
    (alt.comp.anti-virus)