我使用 db dataobject,因此使用 quickform。我遇到了一个问题。想要在客户端设置验证以检查文件扩展名。找不到出路。
字段是这样的:
'pathname' => array(
'type' => 'varchar',
'size' =>255,
'qf_type'=> 'text',
'require' => false,
'qf_client' => true,
'qf_rules' = array('required' => 'file name is required.'),
);
现在我想要一个验证,以在正则表达式的帮助下检查文件的扩展名是否与某些特定格式匹配。
如果有人有想法,请分享。
最佳答案
设置路径名['qf_rules']['regex']时问题已解决。
关于php - 快速表单验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7776695/