I am using ajax to call a file on click of a 'card' to display a dialog box. It worked fine as normal html with php but now that I've saved it as a php variable it doesn't like the if statement and the drop downs always show the default 'choose' option. Can this be done? Or maybe I'm just writing it wrong?
$html.="<select name='priority'>";
$html.="<option>---Choose---</option>";
$html.="<option if ($priority == 'Low') echo 'selected' value='Low'>Low</option>";
$html.="<option if ($priority == 'Normal') echo 'selected' value='Normal'>Normal</option>";
$html.="<option if ($priority == 'High') echo 'selected' value='High'>High</option>";
$html.="<option if ($priority == 'Critical') echo 'selected' value='Critical'>Critical</option>";
$html.="</select>";