Codeigniter- How to preserve form values if error on submit
问题 I have the form field like <input type="text" class="form-control" name="postal_code" id="form_control_1" value="<?php if($user->postal_code === NULL) { echo set_value('postal_code');} else { echo $user->postal_code;} ?>"> <label for="form_control_1">Postal Code</label> <span class="help-block">Postal Code is required</span> and my function is public function postProfile() { if ($_POST) { $this->form_validation->set_rules('postal_code', 'Postal Code', 'required'); $this->form_validation->set