-1
I have an application where a table is dynamically loaded via ajax, and within the table there is a condition, if the condition is true I have to load a checkbox next to each name that is loaded, only that when I load my application and try to choose one of the checkbox, the checkbox does not remain checked
CALLED AJAX
$.ajax({
type: "POST",
url:"inserir_sc_ajax.php",
data:dados,
success: function(result){
if(result.length > 2){
$("#fluxo").html('');
$("#fluxo").append(result);
}else{
var option = "<option value='' >Nao Existe Fluxo para Este Grupo</option>";
$("#fluxo").html('');
$("#fluxo").append(option);
}
}
});
CODE
while ($ln2 = mysql_fetch_array($query)) {
if($ln2['codNIvel'] == 2){
echo "<tr>";
echo "<td> <input type='checkbox' checked name='codRequestManager' value='{$ln2['codUser']}' /> ". $ln2['nome'] ." </td>";
echo "</tr>";
}else{
echo "<tr>";
echo "<td> ". $ln2['nome'] ." </td>";
echo "</tr>";
}
}
Already tried checked='checked' or checked=true ?
– Manuel Gerardo Pereira
already yes... in the code is actually not to have the "checked", I put as test and forgot to take
– Tafarel_Brayan
You can better explain what you want. You want to have the checkbox selected by default?
– Manuel Gerardo Pereira
when my table appears, if the lines fall in condition, the checkbox will appear (unchecked), then I will click on one of them to then do another action...only that the checkbox is not marked when I click on any of them
– Tafarel_Brayan
I only sell all the code, including css. It may be that there is some other element, for example, above the checkbox, or you have some disabled = true lost in the code.
– Manuel Gerardo Pereira