简体   繁体   English

jQuery验证引擎格式错误

[英]jquery validation engine format error

I cannot, for the life of me, figure out how to get the validation engine to return only the custom error message. 我一生无法解决如何使验证引擎仅返回自定义错误消息的问题。 If I do something as simple as: 如果我做的事情很简单:

<input type="text" class="input-block-level validate[required,custom[email]]" name="email" id="email" placeholder="Email address">

and then leave the email input blank in my form, I receive validation saying "*This field is required" AND "*Invalid email address". 然后在我的表单中将电子邮件输入保留为空白,我收到确认消息,指出“ *此字段为必填项”和“ *无效的电子邮件地址”。 I only want to display "*Invalid email address". 我只想显示“ *无效的电子邮件地址”。 The demo shows that this is possible ( validation demo ) but the source code for the demo looks like mine, yet the demo properly displays "*Invalid email address" only! 该演示表明这是可行的( 验证演示 ),但是该演示的源代码看起来像我的,但是该演示仅正确显示“ *无效的电子邮件地址”!

On Validation Demo page, it shows only one message because they have already provided some value in the input box. 在“验证演示”页面上,它仅显示一条消息,因为它们已经在输入框中提供了一些值。 Try to remove the value from the field and hit submit. 尝试从字段中删除该值,然后单击提交。 It will display 2 message there too. 那里也会显示2条消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM