CodeIgniter表单验证greater_than_equal_to无法正常工作

时间:2016-02-02 08:23:31

标签: php codeigniter

我有这段代码

$this->form_validation->set_rules('MinimumSalary', 'Minimum Salary', 'trim|required|min_length[1]|max_length[20]|numeric|greater_than_equal_to[0]');
$this->form_validation->set_rules('MaximumSalary', 'Maximum Salary', 'trim|required|min_length[1]|max_length[20]|numeric|greater_than_equal_to[MinimumSalary]');

然而当我输入MinimumSalary = 100和MaximumSalary = 200,The Maximum Salary field must contain a number greater than or equal to Minimum Salary

时,它总是会引发错误

1 个答案:

答案 0 :(得分:1)

试一下

'trim|required|min_length[1]|max_length[20]|numeric|greater_than_equal_to['.$this->input->post('MinimumSalary').']');