Answer the question
In order to leave comments, you need to log in
How to select a checked attribute in a while loop?
while($arEnum = $UF_TIP_COMPANY->GetNext()){
echo "<label><input type='checkbox' value='".$arEnum["ID"]."' name='UF_TIP_COMPANY[]'";
if(key($UF_TIP_COMPANY->GetNext())){ echo "checked";}
echo">".$arEnum["VALUE"]."</label><br />";
}
<?
while($arEnum = $UF_TIP_COMPANY->GetNext()){
foreach($ppi as $key=>$value){
//echo $arEnum['ID']."=>".$value."<br />";
echo "<label><input type='checkbox' value='".$arEnum["ID"]."' ";
if($arEnum["ID"]==$value){
echo "checked";
}
echo " name='UF_TIP_COMPANY[]' />".$arEnum["VALUE"]."</label><br />";
}
}
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question