Menu
When retrieving values from a database to display on a form I want to “check” a checkbox based on the value of one of the retrieved form text fields. For example something like this:
<?
if ($textfield1 = ‘abc’) {
$checkbox=’checked’;
?>
but I don’t think this works !!
I have a javascript that will change the text field value to ‘abc’ when checked (and to blank when unchecked) – however I just need the PHP code to set the checkbox when the form is first loaded with retrieved database values. I don’t wish to store the checkbox value in the database – just the text value.
Any suggestions please !!