title: prevent form submit with empty input?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/8029532/how-to-prevent-submitting-the-html-forms-input-field-value-if-it-empty">How to prevent submitting the HTML form’s input field value if it empty</a>  </p>
  </blockquote>
  
  
  
  <pre><code>&lt;?php
  
  include '../core/init.php';
  if(isset($_POST['nt']) &amp;&amp; isset($_POST['ntb'])){
  mysql_query("INSERT INTO `post` (`myid`, `text`) VALUES ('".$_SESSION['id']."', '".mysql_real_escape_string($_POST['nt'])."')");
  }
  ?&gt;
  
  &lt;iframe style="display:none" name="submissiontarget" id="submissiontarget"&gt;&lt;/iframe&gt;
  &lt;form method="post" target="submissiontarget" action = "../ajax/post.php" name="form"&gt;
  &lt;input type="textbox" name="nt" class="postwall" id="nt"  placeholder="Post on your wall" rows="7" wrap="physical" cols="40" onfocus="if(this.value=='Post On Your Wall')this.value='';" onblur="if(this.value=='')this.value='Post On Your Wall';" /&gt;
  &lt;input type="submit" style="display:none;" name='ntb' id='ntb'  class="Buttonchat"     value="Post" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I want to be able to do it so if the textbox is blank it says, 'Their was an error posting on your wall, please try again'.</p>