Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#16208 closed defect (worksforme)

dijit.form.TextBox.get('value') returns (almost) null with IE8

Reported by: Alexander Kläser Owned by: Douglas Hays
Priority: undecided Milestone: tbd
Component: Dijit - Form Version: 1.8.1
Keywords: Cc:
Blocked By: Blocking:

Description

We observed a strange behaviour with TextBoxes? in Dojo 1.8.1. With IE8 (Windows XP), an emtpy TextBox? would return null as value. Well, not really null, as (value === "") is true and (value === null) is false, its type is string, however dojo.toJson() would render it as "null".

Example: http://jsfiddle.net/rVmbK/8/ -> remove the text in the textbox and press Tab.

As workaround, we use:

if (value === "") {
    value = "";
}

Although this workaround seems to be meaningless, it helps. The same problem would not occur with Dojo 1.6.

Attachments (3)

16208.jpg (28.5 KB) - added by Douglas Hays 10 years ago.
screenshot showing it working
screenshot-ie8-null-bug.png (114.2 KB) - added by Alexander Kläser 10 years ago.
Screenshot that shows that the bug can be reproduced
worksForBill.gif (205.5 KB) - added by bill 10 years ago.
it correctly gives "" for me from the JSFiddle site

Download all attachments as: .zip

Change History (20)

Changed 10 years ago by Douglas Hays

Attachment: 16208.jpg added

screenshot showing it working

comment:1 Changed 10 years ago by Douglas Hays

Resolution: worksforme
Status: newclosed

Using your example on my IE8 install, toJson returns "" and everything looks correct.

Changed 10 years ago by Alexander Kläser

Attachment: screenshot-ie8-null-bug.png added

Screenshot that shows that the bug can be reproduced

comment:2 Changed 10 years ago by Alexander Kläser

Thanks for your answer.

That is strange. We were 2 people that could reproduce the bug independently with the jsfiddle sample (see screenshot). I'm using Windows XP Professional Version 2002 Service Pack 3 here. Do you have any idea from where the difference may come? Both browser seem to be exactly the same version. I tried to change security settings, but that would not change the result. As said, the bug would occur only with Dojo 1.8.

Version 0, edited 10 years ago by Alexander Kläser (next)

comment:3 Changed 10 years ago by Alexander Kläser

We also observed the problem on another system running Windows Vista with IE8. IMHO is WORKSFORME not appropriate.

Changed 10 years ago by bill

Attachment: worksForBill.gif added

it correctly gives "" for me from the JSFiddle site

comment:4 Changed 10 years ago by Douglas Hays

Perhaps some kind of non-standard compatibility mode/document mode/quirks mode via the debugger? Just throwing out ideas.

comment:6 Changed 10 years ago by bill

Interesting. So, this works correctly on my IE8:

>> JSON.stringify(document.createElement("input").value)
""""

I guess it returns "null" on yours?

comment:7 in reply to:  6 Changed 10 years ago by Alexander Kläser

Replying to bill:

[...] I guess it returns "null" on yours?

Yes, my IE8 outputs "null" with this piece of code. But this cannot be a Browser issue as our browser versions do match exactly (as far as I could see). Maybe its only a bug with service pack 3? Do you have service pack 3 or 2?

comment:8 Changed 10 years ago by bill

Hmm, I'm running service pack 3 too.

comment:9 Changed 10 years ago by Alexander Kläser

There seems to be an update that addresses problems in the native JSON implementation: http://support.microsoft.com/kb/976662

Looking on my Windows system, I found the following versions of jscript.dll:

  • C:\WINDOWS\system32 → version 5.8.6001.18702
  • C:\WINDOWS\ServicePackFiles?\i386 → version 5.7.0.16599

Maybe my IE8 is using the older version of the two libs?

Last edited 10 years ago by Alexander Kläser (previous) (diff)

comment:10 Changed 10 years ago by bill

Hmm, interesting. It sure looks like that update is the difference between our systems.

It seems like IE would be using the jscript.dll in C:\WINDOWS\system32. And my version of C:\WINDOWS\system32\jscript.dll is 5.8.6001.23141... a little bit newer than yours.

comment:11 Changed 10 years ago by Alexander Kläser

Ok. Do you want me to add the .dll file to the bug?

comment:12 Changed 10 years ago by Alexander Kläser

Looks like you have the following Update installed: http://support.microsoft.com/kb/2510531

comment:13 Changed 10 years ago by bill

OK. So why did Doug and I get these updates but you didn't?

comment:14 Changed 10 years ago by Alexander Kläser

Probably because I'm using a bit older virtual machine image that I have not updated.

comment:15 Changed 10 years ago by bill

OK, meaning that Windows Update automatic updates are not turned on? I don't think that's something that we want to support.

comment:16 Changed 10 years ago by Alexander Kläser

OK, this seems reasonable then.

Note: See TracTickets for help on using tickets.