Hello!
I have the following problem:
I have a variable named "$address_type" which could be either "home", "work" or "other".
The data is exported from the MySQL database & assigned to the variable.
I want this code to work:
if ($address_type = "home")
{
$display_block .= "
<input type=\"radio\" name=\"tel_type\" value=\"home\" checked> home
<input type=\"radio\" name=\"tel_type\" value=\"work\"> work
<input type=\"radio\" name=\"tel_type\" value=\"other\"> other";
}
else if ($address_type = "work")
{
$display_block .= "
<input type=\"radio\" name=\"tel_type\" value=\"home\"> home
<input type=\"radio\" name=\"tel_type\" value=\"work\" checked> work
<input type=\"radio\" name=\"tel_type\" value=\"other\"> other";
}
else
{
$display_block .= "
<input type=\"radio\" name=\"tel_type\" value=\"home\"> home
<input type=\"radio\" name=\"tel_type\" value=\"work\"> work
<input type=\"radio\" name=\"tel_type\" value=\"other\" checked> other";
}
The above is supposed to compare the "$address_type" variable's contents & accordingly assing the "checked" value on one of the above Radio Buttons...
But even though the variable is assigned diff values from the database, the "checked" option is not assigned properly at all!!!
What is wrong?
Thanks.