Checkbox
Permalink
I have a function called CheckBoxToInt.
And this is how I use it in the controller.php of my block.
$action is a checkbox.
When I check to $action checkbox I still get the value "on" instead of 1.
Some one got any clue?
Sorry for the pore spelling :)
function CheckBoxToInt($value) { if($value == "on") $value = 1; else $value = 0; return $value; }
And this is how I use it in the controller.php of my block.
$db->query($query, array($pageID, CheckBoxToInt($action)));
$action is a checkbox.
When I check to $action checkbox I still get the value "on" instead of 1.
Some one got any clue?
Sorry for the pore spelling :)
Did you ever get an answer for this?
Hi,
Try this
Try this
function CheckBoxToInt($value) { if($value == "on"){ $v = 1; }else{ $v = 0; } return $v; }
I was thinking the same thing. I was also thinking that it could have been an issue with the way the textbox was defined. You can just have the texbox return 1 or 0 instead of "on". Just removing that method all together if it isnt needed. I was just trying to be helpful and thanks for the input openjuicevijay : )