Hi, Still in F1.0.6. I have a checkbox element with one box with value 'present'.
Now regardless whether it is checked or not it registers 'present' in the database. (I believe that's php behaviour?!).
In the database I actually want to see whether it is checked or not.
How to deal with this? I tried:
1. in the element set "Data to record if no checkboxes ticked" to another value eg 'not present'
but that did not return that result to the database (bug?) and I guess it would not work when we would have more than 1 item in the element.
2. on form submit a script that returns a value on the condition 'checked or not'
i tried something like (the id of the checkbox is jos_fabrik_formdata_13___ss01p):
returns a parse error
any useful comments?
Now regardless whether it is checked or not it registers 'present' in the database. (I believe that's php behaviour?!).
In the database I actually want to see whether it is checked or not.
How to deal with this? I tried:
1. in the element set "Data to record if no checkboxes ticked" to another value eg 'not present'
but that did not return that result to the database (bug?) and I guess it would not work when we would have more than 1 item in the element.
2. on form submit a script that returns a value on the condition 'checked or not'
i tried something like (the id of the checkbox is jos_fabrik_formdata_13___ss01p):
Code:
if(isset(jos_fabrik_formdata_13___ss01p_0)){
$sql="UPDATE jos_fabrik_formdata_13 SET ss01p='present' WHERE bwof_join='x'";
}else{
$sql="UPDATE jos_fabrik_formdata_13 SET ss01p='not present' WHERE bwof_join='x'";
}
$database->setQuery($sql);
$database->query()
any useful comments?