I need not show a div when in a php if structure.
I’m doing:
<?php
$a = $_POST['somefiledcomingFromform'] ; //equals 1
if (isset($_POST['submit'])) {
if($a==1){
// echo"<script>$(document).ready(function() { $('.delete').css(\"display\", \"none\")});</script>";
echo"<script>$('.delete').css(\"display\", \"none\");</script>";
}
}
echo"<div class='delete'>Delete me</div>";
?>
But it’s not working, the div shows it does not matter what line I use inside de if ..
what am I doing wrong?
Thanks a million
Instead of putting in JavaScript, why don’t you do something like this: