I thought I understood how to escape things, but this is just blowing my mind. I need to take this html/php combo text:
<select name="mainUsers" class="manageSelect">
<?php
$users = getAllUsersByUserId($userid);
echo'<option value="choose">Select a user...</option>';
while($user = mysql_fetch_array($users)) {
echo'<option value='.$user['fname'].' '.$user['lname'].'>'.$user['fname'].' '.$user['lname'].'</option>';
}
?>
</select>;
and set it as the innerHTML of a javascript var. Its crashing because I don't have my escape syntax correct.
EDIT: Sorry for being unclear. This isn't working and I don't know why:
cell2.innerHTML =
<?php
echo '<select name="mainUsers" class="manageSelect">';
$families = getAllFamiliesByUserId($userid);
echo '<div id="famSelect"><option value="choose">Select a family...</option></div>';
while($family = mysql_fetch_array($families)) {
echo '<div id="famSelect"><option value="'.$family['name'].'">'.$family['name'].'</option></div>';
}
echo '</select>';
?>;
Its crashing?