Javascript call is empty when getting text area on forst pass but not second
<p>I am trying to check a text area has content before sending to the server (all my server side scripts work). The problem is that if text is entered it is not selected when the submit is pressed the first time, but if it is pressed again without touching the text area it shows the text.</p>

<p>some code that works...</p>

<pre><code>    var checkField = document.forms["WriteNewsArticle"]["newsTitleInput"].value;
    if (checkField == null || checkField == "")
        {
        formOK = false;
        formErrors = formErrors + 1;
        formErrorMsg[formErrors] = "\tTitle field must be completed";
        }

    var checkField1 = document.getElementById("newsArticleInput").value;

    alert(checkField1);
    if (checkField1 == null || checkField1 == "" || checkField1 == "&lt;br&gt;" )
        {
        formOK = false;
        formErrors = formErrors + 1;
        formErrorMsg[formErrors] = "\tThe article must contain some content";
        }

    var checkField2 = document.forms["WriteNewsArticle"]["newsArticleInput"].value;
    alert(checkField2);
</code></pre>

<p>code that words</p>

<p>to be on the safe site I used two methods and checkFields 1 and 2 both show empty when first pressed but not the second time.</p>

<p>The HTML code:</p>

<pre><code>    &lt;form action="&lt;?php echo $editFormAction; ?&gt;"  enctype="multipart/form-data" id="WriteNewsArticle" accept-charset="ISO-8859-1"  onsubmit="return validateForm();" method="POST" &gt;

                    &lt;div class="input"&gt;&lt;input type="text" name="title" id="newsTitleInput" class="textInput"  value="&lt;?php 
                        if (isset($_POST['title'])) {
                            echo ($_POST['title']); 
                        } ?&gt;"/&gt;&lt;/div&gt;


                &lt;div class="input"&gt;&lt;textarea cols="100" rows = "40" name="newsArticleInput" id="newsArticleInput" class="textArea"&gt;&lt;/textarea&gt; &lt;/div&gt;
</code></pre>

<p>I have this code working on other forms where it is a straight forward input box.</p>

<p>Thanks in advance and apologies if I missed something but I have been searching the web for a day now.</p>

<p>Simon</p>

<p>PS the funny checks are to get round white space and when left empty for some reason a <br> is injected. Again these work OK server side and in Javascript. Its just this problem sith not picking up the text on the first pass..</p>
