【问题标题】:Error using validation form using required and a callback funcion使用必需和回调函数使用验证表单时出错
【发布时间】:2021-10-04 05:55:38
【问题描述】:

Codeigniter 3
我正在使用需要和回调函数的验证表单。
但它不起作用,我在编辑控制器和视图中。
当我用确实存在的蜂窝电话调用回调函数时,它告诉我蜂窝电话存在。但是当我尝试将蜂窝更改为另一个时,它告诉我 You must enter the cellular, 只是无法将手机号码更改为另一个新号码。

<php echo form_error('volasoccel' );>
<input value='$volasoc[0]->Celular;  required   type='text' name="volasoccel" class="form-control" id="volasoccel" placeholder="Celular" >


$this->form_validation->set_rules('volasoccel', 'Celular',required| 'callback_volasoccel_check[tvolasoc.TVOLASOC_CEL]|numeric|trim|xss_clean',
                array('required' => 'Debe ingresar el Celular'));

【问题讨论】:

标签: codeigniter-3


【解决方案1】:

您的要求应该用单引号括起来:

'required| callback_volasoccel_check[tvolasoc.TVOLASOC_CEL]|numeric|trim|xss_clean'

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-11-15
    • 2013-07-27
    • 1970-01-01
    • 2013-04-12
    • 1970-01-01
    • 2015-07-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多