Return to Snippet

Revision: 50437
at August 22, 2011 00:15 by alberomo


Initial Code
function isFilled(field) {
  if (field.value.length < 1 || field.value == field.defaultValue) {
    return false;
  } else {
    return true;
  }
}

Initial URL

                                

Initial Description
Arguments: Element from a form.
Take that element and checks if is filled. If not, returns false. If is filled, returns true.
From book Dom Scripting by Jeremy Keith

Initial Title
isFilled (form element) Function

Initial Tags
javascript, DOM, validation

Initial Language
JavaScript