I'm creating some checkboxes via php like this:
$query = mysql_query("SELECT user FROM login");
while ($row = mysql_fetch_assoc($query)) {
$readUser = $row['user'];
if($readUser == "mod"){}
else {
$checkboxUserId = $readUser;
echo "<p><input class='filled-in item' type='checkbox' id='$checkboxUserId' checked='checked' /><label for='$checkboxUserId'>Team: $checkboxUserId</label></p>";
}
some code after this, I do:
I'm drawing some polygones via a Javascript function based on some values I stored in a database.
$query = mysql_query("SELECT * FROM questionAnswers");
while ($row = mysql_fetch_assoc($query)) {
$readUser = $row['user'];
$someMoreVars = $row['var']; //like ten more or that
if ($user == "mod"){
if ($readUser == "mod"){}
else{
echo "drawUserPoly($someMoreVars, $iDontWantToListThemAll, $thatsJustForTheContext)";
//Some More Code here
}
Now the problem: I need to check for the checkboxes which one is checked so i don't draw them and this needs to be updated live (like: checking the checkbox again and the polygon will be drawn, uncheck the checkbox and the polygon is not drawn).
my attempt:
else {
if(isset($_POST['$readUser'])){
echo "drawUserPoly($someMoreVars, $iDontWantToListThemAll, $thatsJustForTheContext)";
}
}
my second attempt:
else {
if($_POST['$readuser'] == 'checked'){
echo "drawUserPoly($someMoreVars, $iDontWantToListThemAll, $thatsJustForTheContext)";
}
}