简体   繁体   中英

Using jQuery Validator like facebook;

How can I use jQuery validator like facebook signup page? Only one box for the results of error?

Thanks,

Lincoln

You can use the jquery validation plugin: http://docs.jquery.com/Plugins/validation

Here's an example: http://docs.jquery.com/Plugins/validation#Example

You mean this:

在此处输入图片说明

Well facebook dosen't use jQuery for this. Instead the php script on their server validated the username Password and injects its HTML.

You dont even need jquery for this unless you are validating Username Password from an Ajax Call.

That said filling a div woth Error message is quite straight Formward:

$("#divID").html = "We have an Error";

Yes stated above by the others, the jQuery validation plugin can do what you are asking for:

General information on the validation plugin: http://docs.jquery.com/Plugins/Validation

Different options using the validation plugin: docs.jquery.com/Plugins/Validation/validate#toptions

Read up on how the validation plugin works. It's very simple. And when you ready to implement the error messaging, read about "errorPlacement" in the validation options page linked above. That is one way to go about implementing your form validation and messaging.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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