Our Ajax Conventions–Validation

As I mentioned in my previous posts, I’m doing a write up of our AJAX conventions and how they’re paying off for us.

In this series of posts, I’m going to cover a few topics:

  1. The AjaxContinuation
  2. Clientside Continuations
  3. Request Correlation
  4. Validation (this post)

Correlation by form

Last time I discussed how to correlate your requests with jquery.continuations. One of the gems that ships with continuations is the $.fn.correlatedSubmit method for forms. This method uses the id of the form (a quick unique check is performed) as the correlation id.

fubuvalidation.js

Note:
This isn’t an exhaustive explanation of the new fubuvalidation.js bits. I’ll flush this out in the docs.

Not another one…

First off: no, it’s not “another js validation library”. fubuvalidation makes use of the continuation contract but makes no effort to perform client-side validation. Instead, it aims to bridge that gap between client-side and server-side validation.

The handler

I’m only explaining this because I know I’ll get asked about it. fubuvalidation.js ships with a default handler. This handler renders a nice validation summary, highlights fields, and provides a little bit of interactivity. And of course, the handler is exposed through $.fubuvalidation.defaultHandler so you can override any of the functions that you don’t like. And like the rest of the Fubu projects, you can completely override our defaults if you don’t like them.

Back to my point…

fubuvalidation.js relies on the continuation that is returned by any of your ajax calls via jquery.continuations. Here’s how we plug into the pipeline:

Just another example of what you can do once you get your conventions defined.

Related Articles:

Post Footer automatically generated by Add Post Footer Plugin for wordpress.

About Josh Arnold

Josh is team lead at Extend Health and a principal developer on the Fubu-family of frameworks. He is a proud husband, terrified but excited father, passionate software guy and coach, closet musician, aspiring man of God, and a perpetual learner.
This entry was posted in General and tagged , , , . Bookmark the permalink. Follow any comments here with the RSS feed for this post.
  • http://www.webhostings.in/ web hosting

    I get it clear idea what i am expecting all the things get it from through this blog.Above all the points are explained very clearly.

  • http://www.register-domainname.in Register domain India

    What a wonderful article? You have described very well. How you got this idea? Great work.