title: Javascript empty field is not properly validate
body: <p>Well, I've a html form which validate by javascript. In this form there a <strong>editor textarea</strong> box. When this box is empty javascript alert message showing "page content require". That's Ok. </p>
  
  <p>But after filled up the content then it's again showing me "page content require". What's is wrong in my code ?</p>
  
  <p><strong>Javascript:</strong></p>
  
  <pre><code>function doStart()
      {       
      var page_name =  document.page.page_name.value; 
      var page_loc = document.page.page_location.value;   
  
      &lt;?php
  
      $page_limit =  mysql_query("SELECT menu_name FROM cms WHERE username = '$username' AND cms_location = 1 ");
      $num_page_limite = mysql_num_rows($page_limit);
      ?&gt;
      var num = &lt;?php echo $num_page_limite; ?&gt;
  
  
      var page_content = document.page.editor_kama.value; 
      var uploadobj = document.getElementById('myuploader');
  
  
      if(page_name == null || page_name == "")
      {
          alert("page name require"); 
          document.page.page_name.focus() ;
          return false;
      }
      else if(page_name.length &gt; 15 )
      {
          alert("page name is too long");
          document.page.page_name.focus() ;
          return false;
      }
  
      if(page_loc == null || page_loc == "")
      {
          alert("Select page location");  
          document.page.page_location.focus() ;       
          return false;
      }
      else if(num == 5 &amp;&amp; page_loc == 1)
      {
          alert("You already creaed 5 pages for your top menu.");
          return false;
      }
  
      if(page_content == null|| page_content == "")       
      {
          alert("Page content require");  
          return false;
      }
  
      if (uploadobj.getqueuecount() &gt; 0)
      {
          uploadobj.startupload();
      }
      else
      {
          alert("Please browse files for upload");
      }
  
  }
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>HTML form:</strong></p>
  
  <pre><code>&lt;form method="post" action="&lt;?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?&gt;" enctype="multipart/form-data" id="form1"  name="page" onSubmit="return validate()"&gt;
      &lt;table width="100%" border="0" cellspacing="10" cellpadding="0" style="float:left; position:relative;"&gt;           
      &lt;tr&gt;
      &lt;td valign="top"&gt;Page Content&lt;/td&gt;
      &lt;td&gt;
      &lt;textarea cols="80" id="editor_kama" name="editor_kama" rows="30" class="textarea"&gt;&lt;?php if(isset($_POST['editor_kama'])) echo $_POST['editor_kama'];?&gt;&lt;/textarea&gt;
       &lt;script type="text/javascript"&gt;
         //&lt;![CDATA[
  
         CKEDITOR.replace( 'editor_kama', {
             skin : 'kama'
         });
  
         //]]&gt;
      &lt;/script&gt;
      &lt;/td&gt;
      &lt;/tr&gt; 
      &lt;tr&gt;
      &lt;td&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td&gt;&lt;input type="submit" name="Submit" value="Create page" class="submit" id="submitbutton" onclick="doStart();return false;"/&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;/table&gt;            
  &lt;/form&gt;
  </code></pre>