nikhilk/scriptsharp — pull request #154 by elkdanger (2012-02-27 14:59:06+00:00)
Title: jQuery Validation plugin implementation

This is a complete implementation of the jQuery Validation plugin, as seen at http://docs.jquery.com/Plugins/Validation.

One thing I have experimented with this particular plugin is how it is called. When developing import libraries internally which map to jQuery plugins, we have preferred to call the plugin passing in the element which should be acted upon, rather than inheriting from jQueryObject and attempting to use jQuery in ScriptSharp as we would in plain Javascript. This removed the need to cast jQueryObjects when calling plugins from ScriptSharp.

In this case, instead of the call being
```((jQueryValidation)jQuery.Select("form")).Validate()```

we can instead call:
```jQueryValidation.Validate(jQuery.Select("form"))```

This is done by asking ScriptSharp to compile the method as `$.fn.validator.call` using a `ScriptAliasAttribute`, which allows us to call a jQuery plugin method by passing the selector in.

Please do let me know your thoughts on this approach.