Welcome Guest, Not a member yet? Register   Sign In
How to parse check boxes in a dynamic html table?
#5

[eluser]toopay[/eluser]
in your view, at checkbox section :
Code:
<?php if ($row->userid != null): ?>
<input type="checkbox" name=<?php echo "selected".$row->roleid; ?> id=<?php echo "selected".$row->roleid; ?> value="<?php echo serialize(array('administrator' => false, 'guest' => true)) ?>" />
<?php else: ?>
<input type="checkbox" name=<?php echo "selected".$row->roleid; ?> id=<?php echo "selected".$row->roleid; ?> value="<?php echo serialize(array('administrator' => true, 'guest' => true)) ?>" />
<?php endif; ?>

Then in your controller, you can either save it as serialized array, or unserialize your post value to array :
Code:
$foo = unserialize($this->input->post('something'));


Messages In This Thread
How to parse check boxes in a dynamic html table? - by El Forum - 06-01-2011, 09:49 PM
How to parse check boxes in a dynamic html table? - by El Forum - 06-02-2011, 12:30 AM
How to parse check boxes in a dynamic html table? - by El Forum - 06-02-2011, 08:42 AM
How to parse check boxes in a dynamic html table? - by El Forum - 06-17-2011, 04:26 PM
How to parse check boxes in a dynamic html table? - by El Forum - 06-18-2011, 04:27 AM
How to parse check boxes in a dynamic html table? - by El Forum - 06-21-2011, 03:27 PM



Theme © iAndrew 2016 - Forum software by © MyBB