I am sure my javascript works, because it works with other form elements.
But I cant get it to work with the textarea...
Textarea.value doesnt seem to work... I read someplace textareas dont have values, so how would you solve this.
Im trying to validate a form and checking if value is empty doesnt work.
Thanks
UPDATE:
some code:
function descriptionValid(fld){
if (fld.value=="") {
document.getElementById("annonsera_descriptionempty_error").style.display='block';
document.getElementById("annonsera_description").focus();
document.getElementById("annonsera_descriptionshort_error").style.display='none';
return false;
}
else if (fld.value.length<3){
document.getElementById("annonsera_descriptionshort_error").style.display='block';
document.getElementById("annonsera_description").focus();
document.getElementById("annonsera_descriptionempty_error").style.display='none';
return false;
}
document.getElementById("annonsera_descriptionempty_error").style.display='none';
document.getElementById("annonsera_descriptionshort_error").style.display='none';
return true;
}
somehow, it doesnt go through the if statements and instead returns true;