samedi 12 mars 2016

simple issue for everyone to solve

this is a very simple thing for me to solve but i'm stuck for some reason -

i've got a checkbox and it says "Checkbox Not Selected" - when I check the checkbox, I want it to say "Checkbox Selected"...and when I do check it, it doesn't say anything - it still stays the same. The code is printed below:

<input type="checkbox" name="check1">
<?php
$c = "Checkbox Not Selected";
$b = "Checkbox Selected";
if (isset($_POST['check1'])) {
 echo $b;
    // Checkbox is selected
} else {
echo $c;
   // Alternate code
}

?>

How do I get it to say "Checkbox Selected" when after I check the checkbox?

Anyone willing to help out here?




Aucun commentaire:

Enregistrer un commentaire