[thelist] js testing for empty fields

Tom Dell'Aringa pixelmech at yahoo.com
Thu Feb 13 09:48:01 CST 2003


--- Kae Verens <kverens at contactjuggling.org> wrote:

> null means "has no value", but "" means "is an empty string" -
> there is
> a difference.

Right, that much I knew, but I'm wondering what the practical
difference is. I can't remember my validations ever failing when
simply testing for value="", is there a case where it would?

> you could also probably get away with this:
> if(myForm.elements['myField'].value.length<1)

Would this for sure cover both cases?


=====
var me = tom.pixelmech.webDeveloper();

http://www.pixelmech.com/
http://www.maccaws.com/
[Making A Commercial Case for Adopting Web Standards]

__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com



More information about the thelist mailing list