CodeIgniter's set_value() not re-populating

前端 未结 4 701
攒了一身酷
攒了一身酷 2020-12-20 20:48

I\'ve checked and re-checked my code, referencing the CI docs and other posts throughout the web, but I am unsuccessful at implementing the set_value() method for re-populat

4条回答
  •  轮回少年
    2020-12-20 21:19

    if you want to use set_data() you need to also use set_rules for that POST/GET field.

    Since you've commented out all your set_rules I can not confirm that this is the issue but most likely it is.

    please check if you have this line in your code

    $this->form_validation->set_rules('fname', 'First name', 'trim|required');

    So if you want to re-populate field with name="fname" you need to have set_rules() // as line above for it otherwise it won't process therefore set_value('fname') is empty.

提交回复
热议问题