[thelist] [JS] Truly checking for empty fields

Edwin Horneij edwin at lanset.com
Fri Apr 9 12:23:43 CDT 2004

This deletes all space characters from a form field's value and checks 
to see if the resulting string is empty. I think I got it's from the 
O'Reilly JS mega-ref.

if ( myform.myfield.value.replace( /\s/g, '' ) == '' ) {
	return false;

More information about the thelist mailing list