hi,
i have a field called "rejected" in a table datatype enum('N','Y')
i want to check a radio button if the value is 'Y' how to do this
this is my html tag for radio button
<input name="optFrom" type="radio" value="Rejected" >
thanks
shiran
php radio
Moderator: General Moderators
If you're checking or not checking the radio depending on the value in the database, you're going to need to set the 'checked' attribute.
Code: Select all
$checked = ($whateverYourDatabaseValue == 'Y') ? "checked = 'checked'" : '';
echo <<<RADIO
<input name = "optFrom" type = "radio" value = "Rejected" $checked />
RADIO;Real programmers don't comment their code. If it was hard to write, it should be hard to understand.