dcsimg

During form validation (ie before submitting form), how can I check if a text area contains any text?

thomas dietrich

You can check the number of charactors enterd by checking the value.length property.

example:

if(document.forms[0].textareaname.value.length == 0){
  don't submit
}else{
  submit this bad boy
}