LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Simple JavaScript Question (https://www.linuxquestions.org/questions/programming-9/simple-javascript-question-128715/)

jacksmash 12-24-2003 04:27 PM

Simple JavaScript Question
 
How would I check to make sure a "textarea" is not left empty?

For example:

<script = 'JavaScript'>

function verify() {

var text = document.formname.details.value;

if (text == "") {
alert ("Invalid");
return false;
}

}

...

<textarea name='details' rows='3' cols='40'></textarea>
...

The problem with this, is even if the textarea is left blank, it still has a length for some reason.

Any ideas?

Thanks and Merry Christmas everyone!


All times are GMT -5. The time now is 12:40 PM.