Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 140161

I want to hide the submit button based on a PHPcondition through javascript

$
0
0
<?php
if(mysql_num_rows($result5)>0)
{
    echo 'condition matched';
    // the above echo is just for testing
    ?>
     <script type='text/javascript'>
     document.getElementById("submitbtn").style.display = "none";

     </script>
    <?php
}
?>

here I am evaluating an if clause, if the condition is true, I want to hide the submit button of the form.

<form action='xyz.php'>
<input type='text'>
<input type='text'>
<input type='text'>
 <input type='submit' id='submitbtn' name='save' value='SAVE' class='form_btn'>
</form>

The condition is evaluating to true, but the submit button is still visible. How do I achieve this??


Viewing all articles
Browse latest Browse all 140161

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>