Zero == empty?

Isn’t this very strange?

[attachment=0]Capture.JPG[/attachment]

Zero value equals to empty string gives true?

The column is a numeric, but I would not expect that this returns true.

I added the following test, but it is still very strange.

typeof(forms[_check_form][_columnname]) == 'string'

That is just the way javascript works.
Because it is loosely typed, it converts the values to the same type before it compares them. Some other examples that also return true:

0    == false
"12" == 12
1    == true
""   == false

If you don’t want javascript to convert the type before comparing the value, you should use the operator “===” instead of “==”:
[attachment=0]Capture.PNG[/attachment]

Joas:
If you don’t want javascript to convert the type before comparing the value, you should use the operator “===” instead of “==”:

Thanks Joas,

I didn’t know that this === operator existed