Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/274.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用引导验证验证表单字段_Php_Forms_Twitter Bootstrap_Validation_Form Control - Fatal编程技术网

Php 使用引导验证验证表单字段

Php 使用引导验证验证表单字段,php,forms,twitter-bootstrap,validation,form-control,Php,Forms,Twitter Bootstrap,Validation,Form Control,我希望你们能给我一个正确的方向。我正在使用html/css和bootstrap创建一个表单。该表单可以正常工作,但我想使用validation states bootstrap提供的功能。我如何以正确的方式使用它?字段只有在正确填充时才会变为绿色,而在出现错误时才会变为红色 有人能给我举个例子,说明如何显示正确的状态吗?(正确填充时为绿色,否则为红色) 使用类。有警告,。有错误,或。有成功 错误状态: <input class="form-control inputForm has-er

我希望你们能给我一个正确的方向。我正在使用html/css和bootstrap创建一个表单。该表单可以正常工作,但我想使用validation states bootstrap提供的功能。我如何以正确的方式使用它?字段只有在正确填充时才会变为绿色,而在出现错误时才会变为红色

有人能给我举个例子,说明如何显示正确的状态吗?(正确填充时为绿色,否则为红色)



使用类
。有警告
。有错误
,或
。有成功

错误状态:

<input class="form-control inputForm has-error" id="ex1" name="voornaam" type="text" placeholder="Voornaam">

正确状态:

<input class="form-control inputForm has-success" id="ex1" name="voornaam" type="text" placeholder="Voornaam">


您需要使用一些javascript。
<input class="form-control inputForm has-success" id="ex1" name="voornaam" type="text" placeholder="Voornaam">