Repopulating checkboxes in Codeigniter after Unsuccessful Form Validation

前端 未结 9 770
梦毁少年i
梦毁少年i 2021-02-04 16:18

I have a problem repopulating a set of checkboxes after an unsuccessful form validation returns the user back to the same form. Dropdown menus and text inputs could be repopulat

9条回答
  •  [愿得一人]
    2021-02-04 16:32

    I actually found that it only works if you use like this:

    form_checkbox('ambience[]', 'value', set_checkbox('ambience[]', 'value'));
    

    You need the square array brackets on the name for it to work properly.

提交回复
热议问题