[英]Bootstrap 3 Form Validation Using built-in Styles
I would like to implement form validation using Bootstrap3's CSS (For Example: On Submit, assuming all forms are filled in correctly, display an "alert alert-success". If failed, display "alert alert-danger" containing an explanation to the failure (Ex: Please enter a valid name). Right now, all I can get to work is requiring text in a field (using HTML5 required tag) without the ability to display any alerts. 我想使用Bootstrap3的CSS来实现表单验证(例如:在Submit上,假设所有表单都正确填写,则显示“ alert alert-success”。如果失败,则显示“ alert alert-danger”,其中包含对失败的解释) (例如:请输入一个有效的名称。)现在,我所能做的就是要求字段中的文本(使用HTML5必需标记)而无法显示任何警报。
Current Code: http://pastebin.com/AjfUA26n 当前代码: http : //pastebin.com/AjfUA26n
Website: http://infenterprises.com/contact/ 网站: http : //infenterprises.com/contact/
You will need to do two things: 您将需要做两件事:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.