how to validate a textarea using javascript
<p>I want to check a textarea whether it is empty or not. For this I write the following code--</p>

<pre><code>function validateForm(theForm) {
    var problem_desc = document.getElementById("problem_desc");

    if (problem_desc.value == '') {
        alert("Please Write Problem Description");
        return false;
    } else {
        return true;
    }
}​
</code></pre>

<p>For the first time it is working fine. But If I remove the text from the textarea the above function is returning true value i.e., it is assuming the previous text I've entered into the textbox. Can anybody kindly tell me where is the problem?</p>
