本文介绍了显示验证错误消息,如工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在html表单上显示验证消息,如下面显示的图像.

how to show validation message like the below shown images on a html form.

我在Web上尝试过,但是找不到类似的验证.因此,尽管在这里问您,也许有人可以帮我解决这个问题.

I tried in Web, but could not found like this validation. So though to ask you here, may be someone can help me with this.

我想显示验证错误消息,如下图所示...

I want to show valdation error message as shown in below image...

请任何人帮助我...

Please anyone help me...

或者喜欢下面的图片

推荐答案

如果您尝试使用自己的javascript并且是新手,那么您将需要大量的学习,因为您应该知道如何使用javascript.DOM元素,并了解其他DOM行为.一个快速的解决方案是使用Jquery库和Jquery验证插件.有太多的Jquery Form验证程序,这些验证程序使用工具提示来显示错误.

If you are trying for your own javascript and you are new to it , then It would take a quite a bit of learning as you should be aware with playing with DOM elements and knowing other DOM behaviors. A quick solution would be using Jquery Library and Jquery Validation Plugin. There are so many Jquery Form validator which makes the use of tooltip to display error.

其中一些是:

http://thrilleratplay.github.io/jquery-validation-bootstrap-工具提示/ http://jqueryvalidationunobtrusivenative.azurewebsites.net/AdvancedDemo/Tooltip http://jquerytools.org/demos/tooltip/form.html
https://github.com/yairEO/validator
https://github.com/posabsolute/jQuery-Validation-Engine

这篇关于显示验证错误消息,如工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 14:25