[thelist] js testing for empty fields

Hershel Robinson hershelr at netvision.net.il
Thu Feb 13 15:11:01 CST 2003

> you could also just check for:
>     if(myForm.elements['myField'].value) { doSomething() }
> assuming your form was anything but boolean

Well, if the user enters 0 (zero) then the above if expression would
evaluate as false in JavaScript, even though the user indeed entered data,
so I wouldn't actually recommend this. :)


More information about the thelist mailing list