I have a switch (checkboxes) and when $checkedans = true then flip the switch to checked else leave default (unchecked).
The error is when i try load the page it just goes white screen.
The switch and all works perfectly without the php inside but i need the if statement. Anyone know why this is happening / know a fix?
My code:
echo"
<td class=\"alarmvalue\" style=\"padding:2px 15px;\">
<label class=\"switch-lightp2 well_\" onchange=\"checkSelectedScheduleType()\">";
if ($checkedans == true) {
echo "<input id=\"radioSelected\" name=\"radioSelected\" type=\"checkbox\" value=\"\" checked>\n"
}else{
echo "<input id=\"radioSelected\" name=\"radioSelected\" type=\"checkbox\" value=\"\">\n";
}
echo" <span><span>keep</span><span>remove</span></span><a class=\"btn btn-primary\"></a>
</label>
</td> "