Showing posts with label jQuery. Show all posts
Showing posts with label jQuery. Show all posts

Thursday, November 29, 2012

HOWTO trigger MVC 3 validation from jQuery


Have you ever wonder how to trigger de MVC 3 form validations from jQuery? ... well, I've done it, and belive me, I spend more than an hour finding out how to. So, the answer is pretty simple: to trigger the validators do something like
$('#MyForm').validate().form();
And for checking if the all the validations get passed look for something like
var isMyFormValid = $('#MyForm').validate().valid();
That's all.

(The answer was found thanks to the ASP.NET forums)

Monday, November 26, 2012

Test your javascript code online


Some time ago thanks to an answer at StackOverflow I discovered an amazing web service called jsfiddle. Basically it allows you to test your JavaScript code online with the option to make use of some of the most popular frameworks out there (like jQuery, Mootools, YUI, Dojo, etc..), and if you need so, you can share your "fiddles" too.

An excellent tool that always come handy.

Friday, November 23, 2012

Monday, September 24, 2012

Cascading dropdown lists with jQuery

Here is a [1]GitHub link to a small jQuery plug-in that helps to make <select> HTML elements to refresh their content from a JSON source in response to the 'change' event of another <select> element.

The code is based on this Stack Overflow thread: http://stackoverflow.com/questions/4458970/cascading-drop-downs-in-mvc-3-razor-view.



[1]https://github.com/manuelnavarroc/jquery.cascade-select