title: Codeigniter Prevent "Blank and "SPACE" in text field"
body: <p>Codeigniter Prevent "Blank and "SPACE" in text field"</p>
  
  <p>How do i prevent user enter blank and "SPACE" in text field and click "submit" , as when they click on submit it will cause ERROR 400. </p>
  
  <p>The code that I have done</p>
  
  <pre><code>$Username=  ($this-&gt;input-&gt;post("username"))? trim($this-&gt;input-&gt;post("username"), " ") : "NIL";
  </code></pre>
  
  <p>What I Want: 
  <br> When User enter blank/SPACE it will show error and redirect back to sign up form </p>