Re-populate checkbox if it fails in validation in an edit form in Codeigniter

前端 未结 5 353
谎友^
谎友^ 2021-01-16 18:13

I works on the an data-edit form in codeigintier. And the problem is about re-populate checkbox

It works if it is an add form (that means I need not concern about th

5条回答
  •  北恋
    北恋 (楼主)
    2021-01-16 18:54

    set_checkbox takes a third argument to set the default state, so basically you have to do something like this

    echo set_checkbox('is_default', 1, $customer_group[0]['is_default'] == "1"); 
    

提交回复
热议问题