1 (edited by renee 2012-03-09 3:36:58 PM)

Topic: checkboxes

Hi,

i`m confused cause the checkboxes won`t be checked and I don`t know why....

in form
<input type="checkbox" name="'.$mediadata[media_id].'_select_form" id='.$mediadata[media_id].'_select"  value="1">

here is the function
function checkALL($data)
{
  $objResponse = new xajaxResponse();
  global $dbfunc,$lang,$_GET,$_SESSION;   
  if($data[checkall]=='on'){$set=true;}else{$set=false;}
  foreach($data as $key=>$element) { $buf=explode('_',$key);  $neuedaten[$buf[0]][$buf[1]]=$element; }
 
  foreach($neuedaten as $media_id => $attr)
  {
    $objResponse->assign( $media_id.'_select', 'checked', $set );
    #$objResponse->assign($media_id.'_select', 'checked', 'checked');
  }
 

  return $objResponse;
}

an the debug message (seem all ok!?)
RECEIVED [status: 200, size: 1149 bytes, time: 330ms]:
<?xml version="1.0" encoding="ISO-8859-1" ?><xjx>
<cmd cmd="as" id="40_select" prop="checked">B</cmd>
<cmd cmd="as" id="38_select" prop="checked">B</cmd>
<cmd cmd="as" id="36_select" prop="checked">B</cmd>
<cmd cmd="as" id="34_select" prop="checked">B</cmd>
<cmd cmd="as" id="35_select" prop="checked">B</cmd>
(...and so on...)
</xjx>