title: I want to hide the submit button based on a PHPcondition through javascript
body: <pre><code>&lt;?php
  if(mysql_num_rows($result5)&gt;0)
  {
      echo 'condition matched';
      // the above echo is just for testing
      ?&gt;
       &lt;script type='text/javascript'&gt;
       document.getElementById("submitbtn").style.display = "none";
  
       &lt;/script&gt;
      &lt;?php
  }
  ?&gt;
  </code></pre>
  
  <p>here I am evaluating an if clause, if the condition is true, I want to hide the submit button of the form.</p>
  
  <pre><code>&lt;form action='xyz.php'&gt;
  &lt;input type='text'&gt;
  &lt;input type='text'&gt;
  &lt;input type='text'&gt;
   &lt;input type='submit' id='submitbtn' name='save' value='SAVE' class='form_btn' &gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>The condition is evaluating to true, but the submit button is still visible. How do I achieve this??</p>