<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Playing with JQuery Validation Library, Part 2</title>
	<atom:link href="http://elegantcode.com/2009/10/26/playing-with-jquery-validation-library-part-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com/2009/10/26/playing-with-jquery-validation-library-part-2/</link>
	<description></description>
	<lastBuildDate>Fri, 12 Mar 2010 14:11:39 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Drito</title>
		<link>http://elegantcode.com/2009/10/26/playing-with-jquery-validation-library-part-2/comment-page-1/#comment-50501</link>
		<dc:creator>Drito</dc:creator>
		<pubDate>Fri, 20 Nov 2009 14:31:27 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/10/26/playing-with-jquery-validation-library-part-2/#comment-50501</guid>
		<description>If you want to include data that will be evaluated at the time of the validation and not only once when the page is loaded, it seems that you can even include fields in the form of functions : 

remote : {
    url: &#039;ManageClients.do&#039;,
    data: {
    	action: &#039;validateUniqueField&#039;,
    	id: function(){return $(&#039;#clientFormDialogId&#039;).val();}
    }
}

Like that, the $(&#039;#clientFormDialogId&#039;).val() will be run each time the validation is executed.

In my case it was necessary because the form is inside a Dialog widget and it is populated via AJAX, so the same form can be used for several objects, and the id element will have no value at all when the page is first loaded, and its value dynamically changes every time an object id loaded into the form.</description>
		<content:encoded><![CDATA[<p>If you want to include data that will be evaluated at the time of the validation and not only once when the page is loaded, it seems that you can even include fields in the form of functions : </p>
<p>remote : {<br />
    url: &#8216;ManageClients.do&#8217;,<br />
    data: {<br />
    	action: &#8216;validateUniqueField&#8217;,<br />
    	id: function(){return $(&#8217;#clientFormDialogId&#8217;).val();}<br />
    }<br />
}</p>
<p>Like that, the $(&#8217;#clientFormDialogId&#8217;).val() will be run each time the validation is executed.</p>
<p>In my case it was necessary because the form is inside a Dialog widget and it is populated via AJAX, so the same form can be used for several objects, and the id element will have no value at all when the page is first loaded, and its value dynamically changes every time an object id loaded into the form.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sergio Pereira</title>
		<link>http://elegantcode.com/2009/10/26/playing-with-jquery-validation-library-part-2/comment-page-1/#comment-50056</link>
		<dc:creator>Sergio Pereira</dc:creator>
		<pubDate>Sat, 31 Oct 2009 19:46:19 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/10/26/playing-with-jquery-validation-library-part-2/#comment-50056</guid>
		<description>If you want to pass more data to the &quot;remote&quot; rule, you can customize the call a lot by passing an options object instead of just the url, like:
remote: { 
 url: &#039;&#039;,
 type: &#039;post&#039;, 
 data: {
    user: $(&quot;#userNameEdit&quot;).val(),
    otherParam: 123 
 }
}</description>
		<content:encoded><![CDATA[<p>If you want to pass more data to the &#8220;remote&#8221; rule, you can customize the call a lot by passing an options object instead of just the url, like:<br />
remote: {<br />
 url: &#8221;,<br />
 type: &#8216;post&#8217;,<br />
 data: {<br />
    user: $(&#8221;#userNameEdit&#8221;).val(),<br />
    otherParam: 123<br />
 }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James</title>
		<link>http://elegantcode.com/2009/10/26/playing-with-jquery-validation-library-part-2/comment-page-1/#comment-49962</link>
		<dc:creator>James</dc:creator>
		<pubDate>Tue, 27 Oct 2009 14:37:21 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/10/26/playing-with-jquery-validation-library-part-2/#comment-49962</guid>
		<description>Hello Chris,

When you get a chance, check out MVC2 Preview 2. This framework solves the client/server-side validation dilema.

This is easily implemented in three steps. First, add attributes or DataAnnotations, to your domain model. Then add these three scripts already included in your MVC project: jquery-1.3.2.js, jquery.validate.js, and MicrosoftMvcJqueryValidation.js. Finally add this line of code to your View:



There are several advantages here. Client-side validation is the default and if the user has javascript disabled server-side validation is conducted. All of your validation rules are in one location so it is easy to maintain, and you have accounted for both client and server-side validation. What I do not like is it takes the fun out of writing your own jQuery :(

For an easy example read this:
http://blogs.msdn.com/rickandy/archive/2009/10/03/client-side-validation-for-mvc-2-p2.aspx

Thanks for your post,
James</description>
		<content:encoded><![CDATA[<p>Hello Chris,</p>
<p>When you get a chance, check out MVC2 Preview 2. This framework solves the client/server-side validation dilema.</p>
<p>This is easily implemented in three steps. First, add attributes or DataAnnotations, to your domain model. Then add these three scripts already included in your MVC project: jquery-1.3.2.js, jquery.validate.js, and MicrosoftMvcJqueryValidation.js. Finally add this line of code to your View:</p>
<p>There are several advantages here. Client-side validation is the default and if the user has javascript disabled server-side validation is conducted. All of your validation rules are in one location so it is easy to maintain, and you have accounted for both client and server-side validation. What I do not like is it takes the fun out of writing your own jQuery <img src='http://elegantcode.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>For an easy example read this:<br />
<a href="http://blogs.msdn.com/rickandy/archive/2009/10/03/client-side-validation-for-mvc-2-p2.aspx" rel="nofollow">http://blogs.msdn.com/rickandy/archive/2009/10/03/client-side-validation-for-mvc-2-p2.aspx</a></p>
<p>Thanks for your post,<br />
James</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Reflective Perspective - Chris Alcock &#187; The Morning Brew #463</title>
		<link>http://elegantcode.com/2009/10/26/playing-with-jquery-validation-library-part-2/comment-page-1/#comment-49957</link>
		<dc:creator>Reflective Perspective - Chris Alcock &#187; The Morning Brew #463</dc:creator>
		<pubDate>Tue, 27 Oct 2009 07:36:05 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/10/26/playing-with-jquery-validation-library-part-2/#comment-49957</guid>
		<description>[...] Playing with JQuery Validation Library, Part 2 - Chris Brandsma resumes his series looking at JavaScript validation using the JQuery Validation Library, and in this part tackles validation using AJAX validators to check back with the server to see if a value is valid [...]</description>
		<content:encoded><![CDATA[<p>[...] Playing with JQuery Validation Library, Part 2 &#8211; Chris Brandsma resumes his series looking at JavaScript validation using the JQuery Validation Library, and in this part tackles validation using AJAX validators to check back with the server to see if a value is valid [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BjartN</title>
		<link>http://elegantcode.com/2009/10/26/playing-with-jquery-validation-library-part-2/comment-page-1/#comment-49956</link>
		<dc:creator>BjartN</dc:creator>
		<pubDate>Tue, 27 Oct 2009 06:27:09 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/10/26/playing-with-jquery-validation-library-part-2/#comment-49956</guid>
		<description>Small tip on making javascript maintainable: Put it in a separate file and don&#039;t inline server code :) Of course it works for a demo :)</description>
		<content:encoded><![CDATA[<p>Small tip on making javascript maintainable: Put it in a separate file and don&#8217;t inline server code <img src='http://elegantcode.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Of course it works for a demo <img src='http://elegantcode.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
