Verifier si le textarea est vide ou non
Bonjour,
J’ai un petit problème, comment fait on pour vérifier si un textarea est complété ou non?
J’ai fait plusieurs essai mais ça ne marche pas en tout cas pas a chaque fois
Voilà ce que j’ai fait :
Code:
1 2 3 4 5
| if (document.platform_form.criterion_text.lenght == null)
{
document.platform_form.criterion_text.focus();
alert("<? echo $PLATFORM_CRITERION_ERROR; ?>");
return false; |
Marche pas.
ensuite j'ai également essayé ça:
Code:
1 2 3 4 5 6
| if (document. platform_form. criterion_text.value == "")
{
document. platform_form. criterion_text.focus();
alert("<? echo $DISCRIPTION_ERROR; ?>");
return false;
} |
Marche pas.
Sachant que mon textarea se trouve dans un formulaire qui s’appelle : « platform_form » et le textarea s’appelle « criterion_text »
Quelqu’un pourrais m’aider ?
Par avance merci.