-2

我已经阅读了所有其他问题,包括谷歌上的所有内容。这与我用于注册的相同方法之间没有明显区别。这是一个非常基本的概念,不想工作。

转储 $_POST 会显示正确的空字符串,因此某处出现了其他问题。

控制器

public function details(){
    $this->load->library('form_validation');
    //$this->form_validation->set_message('current-password', 'Incorrect password');
    $this->form_validation->set_rules('current-password', 'Password', 'required');
    $this->load->view('details', $data);
}

看法

<?php echo validation_errors(); ?>
<?php echo form_open('user/details'); ?>
    <input type="password" name="current-password" id="current-password" value=""/>
    <input type="submit" class="submit-save" value="save"/>
</form>
4

1 回答 1

4

您忘记实际运行表单验证:

$this->form_validation->run()

见这里:http ://codeigniter.com/user_guide/libraries/form_validation.html#tutorial

于 2012-09-25T03:05:34.150 回答