这里我有这样的调用字段,所以我必须提到验证,我该怎么做?现在没有验证,但我想制作最小字符8 ??
[ "note", {"label":" Reason why not apply leave before taken","type":"textarea","validation":"none"}]
我有一个文件,文本,文本区域,日期,日期时间等....
以下电子邮件的样本验证
[ "work_email", {"label":"Work Email","type":"text","validation":"email"}],
答案 0 :(得分:1)
您可以使用HTML5的验证。等,
<form method="POST" action="#">
<input pattern=".{8,}" required="required"> <!-- required attribute will make the text box not empty check and pattern attribute is checking for Minimum 8 character -->
<input type="submit" value="Check">
</form>
&#13;
希望这能解决您的问题。
答案 1 :(得分:0)
在我使用的php文件中
if(strlen($req->note) < 6){
return new IceResponse(IceResponse::ERROR,"Please provide the correct reason");
}