开发者

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:

Using jQuery Validator like facebook;

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜