Javascript only checks one field
<p>Ok so I've been stumped on this one for days and its frustrating me. (Will frustrate me even more if it's something simple I'm overlooking).</p>

<p>I have a form generated in PHP which I want to verify that certain pieces are filled out. I do this via a JavaScript check when the user clicks the submit button.The JavaScript code is below:</p>

<pre><code>&lt;script language="JavaScript"&gt;

        function checkFields()
        { 
            if (document.getElementById('ldescription').value == '' || document.getElementById('uname').value == '' 
                || document.getElementById('sdescription').value == '' || document.getElementById('email').value == '' 
                || document.getElementById('platf').value == "Select Group" || document.getElementByID('cate').value == "Select Category" )
            {
                alert("Please fill out all of the starred (*) items" );
                return false;
            }
        }
        &lt;/script&gt;
</code></pre>

<p>For some reason though this only checks the <strong>ldescription</strong> field. If that field has text but all the others are empty it carries on like everything was filled out. Also if I change the order of my checks and <strong>ldescription</strong> is anywhere but the first check, it will do no check whatsoever even when all the fields are empty.</p>

<p>Any ideas?</p>

<p>EDIT:
Got it fixed. Along with the suggestion I marked as correct the <strong>document.getElementById('item').value</strong>  command worked with only textarea boxes but not regular text input boxes. By changing the command to <strong>document.MyForm.myTextName.value</strong> everything fell into place.</p>
