multiple checkboxes |
The problem you are describing is probably here:
PHP Code: if ($db_key = array_search($val, $services)) If $val is the first entry in $services, the key is probably 0, so your if() statement evaluates to false and moves on to the else clause. The manual entry for array_search() includes a warning about this behavior: http://php.net/manual/en/function.array-...turnvalues So, you could rewrite this as: PHP Code: $db_key = array_search($val, $services); or you could do something like this: PHP Code: $db_key = array_search($val, $services); or you could use the form helper's form_checkbox() or set_checkbox() functions. https://codeigniter.com/userguide2/helpe...elper.html |
Messages In This Thread |
multiple checkboxes - by prtk418 - 07-07-2016, 01:56 PM
RE: multiple checkboxes - by mwhitney - 07-08-2016, 07:54 AM
|