Re: checkbox value
| From: | afan@afan.net | Date: | Thu, 24 Mar 2005 14:23:40 +0000 |
| Subject: | Re: checkbox value | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-211469@lists.php.net to get a copy of this message | ||
# index.php
<form method=post action=index.php>
<?php
$checked = ($_POST['CheckThis'] == 'Yes') ? 'checked' : '' ;
<input type=checkbox name=CheckThis value=Yes <?= $checked ?>>
<input type=Submit value=Submit>
</form>
-afan
William Stokes wrote:
Hello, I have a checkbox in a form. How can I determine if the user has set the checkbox on or not? Thanks -Will