<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>jquery-dialog &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/jquery-dialog/</link>
	<description>Feed of posts on WordPress.com tagged "jquery-dialog"</description>
	<pubDate>Thu, 23 May 2013 23:49:52 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Show Partial view as popup with Actionlink]]></title>
<link>http://sameercode.wordpress.com/2013/04/13/show-partial-view-as-popup-with-actionlink/</link>
<pubDate>Sat, 13 Apr 2013 03:22:40 +0000</pubDate>
<dc:creator>Sameer Sharma</dc:creator>
<guid>http://sameercode.wordpress.com/2013/04/13/show-partial-view-as-popup-with-actionlink/</guid>
<description><![CDATA[use Jquery dialog to open the partial view as popup. Change in View: //add class to action link and]]></description>
<content:encoded><![CDATA[<p>use Jquery dialog to open the partial view as popup.</p>
<p>Change in <strong>View:</strong></p>
<p><span style="color:#339966;">//add class to action link and get the actionlink click using .classname in jquery.</span></p>
<p>@Html.ActionLink(&#8220;link text&#8221;, &#8220;actionName&#8221;, &#8220;controllerName&#8221;,  new {@class=&#8221;popupLink&#8221;})</p>
<p>&#60;script type=&#8221;text/javascript&#8221;&#62;<br />
$(function () {<br />
$(&#8216;.popupLink&#8217;).click(function () {<br />
$(&#8216;&#60;div id=&#8221;popupfooterdiv&#8221;/&#62;&#8217;).appendTo(&#8216;body&#8217;).dialog({<br />
close: function (event, ui) {<br />
dialog.remove();<br />
},<br />
modal: false,<br />
draggable: false,<br />
width: 500,<br />
height: 400,<br />
resizable: false,<br />
//open: function (event, ui) {<br />
//    $(&#8216;.ui-dialog-title&#8217;).remove();<br />
//}<br />
}).load(this.href, {});<br />
return false;<br />
});<br />
});<br />
&#60;/script&#62;</p>
<p>&#160;</p>
<p>In<strong> Controller</strong></p>
<p>[HttpPost]</p>
<p>public ActionResult actionName()</p>
<p>{</p>
<p>return PartialView();</p>
<p>}</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Create a simple jquery-ui dialog box]]></title>
<link>http://sanjaytriumph.wordpress.com/2013/02/11/create-a-simple-jquery-ui-dialog-box/</link>
<pubDate>Mon, 11 Feb 2013 09:40:17 +0000</pubDate>
<dc:creator>Sanjay Triumph</dc:creator>
<guid>http://sanjaytriumph.wordpress.com/2013/02/11/create-a-simple-jquery-ui-dialog-box/</guid>
<description><![CDATA[Suppose you want to open this follwing element like a dialog box:- &lt;div id=&#8221;dialog&#8221; t]]></description>
<content:encoded><![CDATA[Suppose you want to open this follwing element like a dialog box:- &lt;div id=&#8221;dialog&#8221; t]]></content:encoded>
</item>
<item>
<title><![CDATA[Using colorbox component in your ASP.NET Application]]></title>
<link>http://sagarworld31.wordpress.com/2013/01/02/using-colorbox-component-in-your-asp-net-application/</link>
<pubDate>Wed, 02 Jan 2013 11:34:45 +0000</pubDate>
<dc:creator>Sagar Rawal</dc:creator>
<guid>http://sagarworld31.wordpress.com/2013/01/02/using-colorbox-component-in-your-asp-net-application/</guid>
<description><![CDATA[You need to first download the colorbox.js file from the link given below. http://www.jacklmoore.com]]></description>
<content:encoded><![CDATA[<p>You need to first download the colorbox.js file from the link given below.</p>
<p><a href="http://www.jacklmoore.com/colorbox" title="colorbox" target="_blank">http://www.jacklmoore.com/colorbox</a></p>
<p>Get the JS file and colorbox.css file which will be useful when you want to open any popup(jQuery dialog).</p>
<p>So at first you need to import css file and js file into your project.<br />
Similar like this</p>
<p><a href="http://sagarworld31.wordpress.com/2013/01/02/using-colorbox-component-in-your-asp-net-application/capture/" rel="attachment wp-att-496"><img src="http://sagarworld31.files.wordpress.com/2013/01/capture.jpg?w=300&#038;h=14" alt="Import File" width="300" height="14" class="alignnone size-medium wp-image-496" /></a></p>
<p>Create an anchor tag and give any class to them. (Remember class must be the unique.) and in href option you can write link where you want to redirect. Here i need to use the imagebutton so i am combining anchor tag and imagebutton </p>
<p><a href="http://sagarworld31.wordpress.com/2013/01/02/using-colorbox-component-in-your-asp-net-application/capture1/" rel="attachment wp-att-498"><img src="http://sagarworld31.files.wordpress.com/2013/01/capture1.jpg?w=300&#038;h=22" alt="Sample Anchor Tag" width="300" height="22" class="alignnone size-medium wp-image-498" /></a></p>
<p>that&#8217;s it completed from the Designing page now you need to do changes in jQuery to open the popup.</p>
<p>You need to add the jQuery as described follow</p>
<p><a href="http://sagarworld31.wordpress.com/2013/01/02/using-colorbox-component-in-your-asp-net-application/capture2/" rel="attachment wp-att-499"><img src="http://sagarworld31.files.wordpress.com/2013/01/capture2.jpg?w=300&#038;h=117" alt="Sample Code" width="300" height="117" class="alignnone size-medium wp-image-499" /></a></p>
<p>That&#8217;s it You have completed with that and you can now open the jQuery dialog with this.</p>
<p>To close the dialog and reload current page you need to write the code in GoToLink.aspx Page<br />
<code>parent.document.location = parent.document.location;<br />
parent.$.fn.colorbox.close();</code><br />
or you can simply press escape this will close the popup.</p>
<p>You can get more details on the following link.<br />
<a href="http://www.jacklmoore.com/colorbox" title="colorbox" target="_blank">http://www.jacklmoore.com/colorbox</a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[simple jquery popup]]></title>
<link>http://livescript.wordpress.com/2012/05/02/simple-jquery-popup/</link>
<pubDate>Wed, 02 May 2012 12:23:12 +0000</pubDate>
<dc:creator>sekar</dc:creator>
<guid>http://livescript.wordpress.com/2012/05/02/simple-jquery-popup/</guid>
<description><![CDATA[This is a simple and images less jquery popup with just a few lines of javascript in it. You don]]></description>
<content:encoded><![CDATA[<p>This is a simple and images less jquery popup with just a few lines of javascript in it.<br />
You don&#8217;t need to include any <strong>.js</strong> files to make it work.</p>
<p>This dialog will looks like this:<br />
<a href="https://livescript.files.wordpress.com/2012/05/jquery-popup.png"><img class="size-medium wp-image-7 alignleft" title="jquery-popup" src="https://livescript.files.wordpress.com/2012/05/jquery-popup.png?w=300" alt="simple image less jquery popup" /></a></p>
<p><a style="padding-left:50px;" href="https://sourceforge.net/projects/jquerypopup/" target="_blank"><img class="alignnone size-full wp-image-15" title="download jquery popup" src="http://livescript.files.wordpress.com/2012/05/download1.png?w=120&#038;h=120" alt="free download jquery popup" width="120" height="120" /></a></p>
<h4>The Markup</h4>
<p>We need to show some content in the popup box. In our example we are going to create simple login box.</p>
<h5><span style="color:#993300;">index.html</span></h5>
<pre class="brush: xml; title: ; notranslate" title="">
&#60;!--gray overlay--&#62;
&#60;div id=&#34;dialog-overlay&#34; class=&#34;dialog-overlay&#34;&#62;&#60;/div&#62;

&#60;!--login dialog start--&#62;
&#60;div id=&#34;login_container&#34; class=&#34;dialog-box&#34;&#62;
	&#60;div id=&#34;login&#34;  style=&#34;width:300px;padding:5px;&#34;&#62;
		&#60;div class=&#34;dialog-content&#34;&#62;
			&#60;table  class=&#34;dialog-content&#34; style=&#34;margin-top:20px;padding:0;width:100%;&#34; &#62;
				&#60;tr&#62;
					&#60;td&#62;Email : &#60;/td&#62;&#60;td&#62;&#60;input type=&#34;text&#34; id=&#34;log_usr&#34; name=&#34;Email&#34; class=&#34;textpart&#34; style=&#34;width:230px;&#34; /&#62;&#60;/td&#62;
				&#60;/tr&#62;
				&#60;tr&#62;
					&#60;td&#62;Password : &#60;/td&#62;&#60;td&#62;&#60;input type=&#34;password&#34; id=&#34;log_pass&#34; name=&#34;Password&#34; class=&#34;textpart&#34; style=&#34;width:230px;&#34; /&#62;&#60;/td&#62;
				&#60;/tr&#62;
				&#60;tr&#62;
					&#60;td&#62;Country : &#60;/td&#62;&#60;td&#62;&#60;input type=&#34;text&#34; id=&#34;country&#34; name=&#34;country&#34; class=&#34;textpart&#34; allownull=true style=&#34;width:230px;&#34; /&#62;&#60;/td&#62;
				&#60;/tr&#62;
				&#60;tr&#62;
					&#60;td colspan=&#34;2&#34; align=&#34;center&#34;&#62;
						&#60;input id=&#34;log_submit&#34; type=&#34;button&#34; class=&#34;btnstyle&#34; style=&#34;margin-top:10px;&#34; value=&#34;Submit&#34; /&#62;
						&#60;input id=&#34;log_cancel&#34; type=&#34;button&#34; class=&#34;btnstyle&#34; style=&#34;margin-top:10px;&#34; value=&#34;Cancel&#34; /&#62;
					&#60;/td&#62;
				&#60;/tr&#62;
			&#60;/table&#62;
		&#60;/div&#62;
	&#60;/div&#62;
&#60;/div&#62;
&#60;!--login dialog End --&#62;

&#60;a href=&#34;javascript:void(0);&#34;  onclick=&#34;javascript:$('#login_container').showX()&#34;&#62;Log In&#60;/a&#62;
</pre>
<h4>The jQuery</h4>
<p>Following few lines of jquery displays our html content as popup box.</p>
<h5><span style="color:#993300;">pbscript.js</span></h5>
<pre class="brush: jscript; title: ; notranslate" title="">
var XDLG=&#34;&#34;;
$(document).ready(function(){

	// CENTERS given element
	jQuery.fn.center = function () {
    	this.css(&#34;position&#34;,&#34;absolute&#34;);
    	this.css(&#34;top&#34;, (($(window).height() - this.outerHeight()) / 2) + $(window).scrollTop() + &#34;px&#34;);
    	this.css(&#34;left&#34;, (($(window).width() - this.outerWidth()) / 2) + $(window).scrollLeft() + &#34;px&#34;);
    	return this;
	}
	
	// SHOW a dialog
	jQuery.fn.showX = function () {
    	// get the screen height and width        
		var maskHeight = $(document).height()+$(document).scrollTop();  
		var maskWidth = $(window).width();
			
		// calculate the values for center alignment
		var dialogTop =  ($(document).scrollTop()+50);    
		var dialogLeft = &#34;100px&#34;; 
	
		// assign values to the overlay and dialogbox
		//$('#dialog-overlay').css({height:maskHeight, width:maskWidth});
		$(this).css({top:dialogTop, left:dialogLeft}).center();

		// display the boxes
		XDLG=&#34;#&#34;+$(this).attr(&#34;id&#34;);
		$(&#34;#dialog-overlay&#34;).show();
		$(XDLG).show();	
	}
	
	// CLOSE a dialog
	jQuery.fn.closeX = function () {
		$(this).clearX();
		$(this).hide();
		$(&#34;#dialog-overlay&#34;).hide();
		XDLG=&#34;&#34;;
	}
	
	
	// CLEAR inputs in a dialog
	jQuery.fn.clearX = function (){	
		$(this).find(&#34;input:text&#34;).val('');	
	}
	
	// VALIDATE inputs
	jQuery.fn.validate = function (type){
		var emfilter=/^[_A-z0-9-]+((\.&#124;\+)[_A-z0-9-]+)*@[A-z0-9-]+(\.[A-z0-9-]+)*(\.[A-z]{2,4})$/;
		
		if(type==&#34;email&#34;){
			return (emfilter.test($(this).val()) ? true : false); 
		}
		else if(type==&#34;inputs&#34;){
			var cvalue=&#34;&#34;;var exception=&#34;&#34;;
			//allownull [ i.e: can be left empty]- custom property.
			//following selects only the input elements which is need to be validated.
			$(this).find(&#34;input:text,textarea,select&#34;).filter(&#34;:not([allownull])&#34;).each( function(){
				cvalue=$(this).val().trim();
				if($(this).get(0).tagName.toLowerCase()==&#34;select&#34; &#38;&#38; cvalue&#60;1){
					exception=$(this).attr(&#34;name&#34;)+ &#34; not selected&#34;;
				}
				else if(cvalue.length&#60;1){
					exception=$(this).attr(&#34;name&#34;)+ &#34; is empty&#34;;
				}
				
			});
			
			if(exception.length&#60;1){
				$(this).find(&#34;input:password&#34;).each( function(){
					cvalue=$(this).val().trim();
					if(cvalue.length&#60;1)
						exception=$(this).attr(&#34;name&#34;)+ &#34; is empty&#34;;
						
				});
			}
			
			
			return (exception.length&#62;0 ? exception : true);
		}
	}
	
	// CLEAR on pressing `esc` button
	$(document).keyup(function(e){
		if(e.keyCode === 27)
			$(XDLG).clearX();
	});

	// CLOSE on clicking on request
	$(&#34;#dialog-overlay,#log_cancel&#34;).click(function(){
		$(XDLG).closeX();
	});

	// SUBMIT the details, may be an ajax request...
	$(&#34;#log_submit&#34;).click(function(){
			
		msg=$(&#34;#login&#34;).validate('inputs');
		if(msg!=true){
			alert(msg);
			return false;
		}
		else if(!$(&#34;#log_usr&#34;).validate('email')){
			alert(&#34;Not a valid email&#34;);
			return false;
		}
		
		alert('OK, make an ajax call!');
	});
});	
</pre>
<h4>The CSS</h4>
<h5><span style="color:#993300;">xlog.css</span></h5>
<pre class="brush: css; title: ; notranslate" title="">
.dialog-overlay {

	/* set it to fill the whil screen */
	width:100%; 
	height:100%;
	
	/* transparency for different browsers */
	filter:alpha(opacity=50); 
	-moz-opacity:0.5; 
	-khtml-opacity: 0.5; 
	opacity: 0.5; 
	background:#000; 

	/* make sure it appear behind the dialog box but above everything else */
	position:absolute; 
	top:0; left:0; 
	z-index:3000; 

	/* hide it by default */
	display:none;
}

.dialog-box {
	
	/* css3 drop shadow */
	-webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
	-moz-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
	
	/* css3 border radius */
	-moz-border-radius: 5px;
    -webkit-border-radius: 5px;
	
	background:#eee;
	
	
	/* make sure it has the highest z-index */
	position:absolute; 
	z-index:5000; 

	/* hide it by default */
	display:none;
}

.dialog-content {
	text-align:left; 
	border: medium none;
	color:#000;
	font-family:arial,helvetica,sans-serif;
	font-size:12px;
	
}
.textpart{
	text-align:left; 
	border: 1px solid #E5E5E5;
	color:#666666;
	font-family:verdana,geneva,sans-serif;
	font-size:12px;
	padding-left:4px;
	height:30px;
}
.btnstyle{
	background-color: #F5F5F5;
    background-image: -moz-linear-gradient(center top , #F5F5F5, #F1F1F1);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 2px 2px 2px 2px;
    color: #666666;
    cursor: pointer;
    font-family: arial,sans-serif;
    font-size: 11px;
    font-weight: bold;
    height: 25px;
    line-height: 23px;
    min-width: 54px;
    padding: 0 8px;
    text-align: center;
}
.btnstyle:hover{
	-webkit-box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2);
	-moz-box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2);
}
</pre>
<p>Thats it!. What we&#8217;ve done is, initially we have created content to show in the popup and added bit of jquery to set the content hidden when page loads also we&#8217;ve added some functions to show and hide the div.</p>
<p>When you load <strong>index.html</strong> it will shows you an anchor link as <em>Login</em>. if you click the link it will pops up the content we&#8217;ve created. To make it disappear just click the outer portion of popup box or click cancel button in the dialog. You make it hide by pressing <em>esc</em> key also.</p>
<h4>Validation</h4>
<p>Other than showing a content as popup, it&#8217;ll validate the elements in the div when you click the submit button.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Creating a jQuery ui Modal Form with Content from External Source]]></title>
<link>http://techfussion.wordpress.com/2012/04/28/creating-a-jquery-ui-modal-form-with-content-from-external-source/</link>
<pubDate>Sat, 28 Apr 2012 03:52:00 +0000</pubDate>
<dc:creator>jfussion</dc:creator>
<guid>http://techfussion.wordpress.com/2012/04/28/creating-a-jquery-ui-modal-form-with-content-from-external-source/</guid>
<description><![CDATA[To create a Modal form that loads a content from an external source or different php/html file, we w]]></description>
<content:encoded><![CDATA[<p>To create a Modal form that loads a content from an external source or different php/html file, we will be using a jQuery function which is $.load(url).<strong></strong></p>
<p style="font-size:10px;"><strong>This assumes that you already know how to setup jQuery and ui in your working page. if not, kindly <a href="http://docs.jquery.com/Tutorials:How_jQuery_Works#jQuery:_The_Basics">read this</a> page.</strong></p>
<p>Now let us create our home page with a button &#8216;Click Me!&#8217;.</p>
<p>index.php:</p>
<pre class="brush: xml; title: ; notranslate" title="">

&#60;html&#62;
    &#60;head&#62;

        &#60;link href=&#34;css/ui-lightness/jquery-ui-1.8.19.custom.css&#34; rel=&#34;stylesheet&#34; type=&#34;text/css&#34;&#62;
        &#60;script src=&#34;js/jquery-1.7.2.min.js&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62;
        &#60;script src=&#34;js/jquery-ui-1.8.19.custom.min.js&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62;

        &#60;title&#62;Demo&#60;/title&#62;
    &#60;/head&#62;
    &#60;body&#62;
        &#60;button id=&#34;click_me&#34;&#62;Click Me!&#60;/button&#62;
    &#60;/body&#62;
&#60;/html&#62;

</pre>
<p>Then let us create our form in seperate file let&#8217;s name it form.php:</p>
<pre class="brush: xml; title: ; notranslate" title="">
&#60;form&#62;
    &#60;label for=&#34;firstname&#34;&#62;First name:&#60;/label&#62;
    &#60;input type=&#34;text&#34; name=&#34;firstname&#34; id=&#34;firstname&#34; /&#62;&#60;br&#62;

    &#60;label for=&#34;lastname&#34;&#62;Last name:&#60;/label&#62;
    &#60;input type=&#34;text&#34; name=&#34;lastname&#34; id=&#34;lastname&#34; /&#62;

    &#60;input type=&#34;submit&#34; name=&#34;submit&#34;/&#62;
&#60;/form&#62;
</pre>
<p>Our goal here is when we click the button &#8216;Click Me!&#8217;, the Modal form will appear in our page with content from form.php witch is a separate file.<br />
We can achieve that goal with this script:</p>
<pre class="brush: jscript; highlight: [4]; title: ; notranslate" title="">
&#60;script type=&#34;text/javascript&#34;&#62;
    $(document).ready(function(){
        $('#click_me').click(function(){
            $('&#60;div&#62;').load('form.php').dialog();
        });
    });
&#60;/script&#62;
</pre>
<p>This line will capture the click event to the button</p>
<pre class="brush: jscript; first-line: 2; title: ; notranslate" title="">
    $('#click_me').click(function(){
</pre>
<p>and this line will load the content of form.php to $(&#8216;&#60;div&#62;&#8217;) and create a modal form.</p>
<pre class="brush: jscript; first-line: 4; title: ; notranslate" title="">
        $('&#60;div&#62;').load('form.php').dialog();
</pre>
<p>Now test it in your preferred browser and your modal form should look like this:<br />
<a href="http://techfussion.files.wordpress.com/2012/04/screenshot-at-2012-04-28-111724.png"><img class="alignnone size-medium wp-image-104" title="Screenshot at 2012-04-28 11:17:24" src="http://techfussion.files.wordpress.com/2012/04/screenshot-at-2012-04-28-111724.png?w=300&#038;h=221" alt="" width="300" height="221" /></a><br />
There you have it! A Modal form with content from external or different php/html file.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Implemation Jquery Dialog client validation and server validation in Asp.net mvc 3]]></title>
<link>http://chuyves.wordpress.com/2012/04/05/jquery-dialog-validation-mvc/</link>
<pubDate>Thu, 05 Apr 2012 11:12:15 +0000</pubDate>
<dc:creator>dtjmsy</dc:creator>
<guid>http://chuyves.wordpress.com/2012/04/05/jquery-dialog-validation-mvc/</guid>
<description><![CDATA[Hi, This article intended to show how to implement Jquery Dialog validation within ASP.net MVC 3, it]]></description>
<content:encoded><![CDATA[<p>Hi,</p>
<p>This article intended to show how to implement Jquery Dialog validation within ASP.net MVC 3, it will skip the steps of how implementing jquery UI dialog, there are many articles around to cover about it.</p>
<p>What I want to do here is to implement the jquery dialog which gets data from a partialview, it will then validate the inputs then send it to the ActionController via an Ajax call</p>
<p>Here are the main steps:</p>
<ol>
<li>Render a Jquery Dialog from PartialView</li>
<li>Validate on client side (if datas are required or not)</li>
<li>Send the datas over as Ajax Call/Json to the server to validate it</li>
</ol>
<p>In order to reduce http calls, ones need to validate as much as possible on client before sending datas to server validation.</p>
<p>Here is what is done for validation:</p>
<p><span style="text-decoration:underline;"><strong>Client Validation</strong></span></p>
<pre>&#60;script src="../../Models/Scripts/jquery.validate.min.js" type="text/javascript"&#62;&#60;/script&#62;
&#60;script src="../../Models/Scripts/jquery.validate.unobtrusive.min.js" type="text/javascript"&#62;&#60;/script&#62;

&#60;button id="btnDialog"&#62;Account Logon&#60;/button&#62;

&#60;div id="Logonform"&#62;&#60;/div&#62;

&#60;script type="text/javascript"&#62;

    $(document).ready(function () {

        $.validator.unobtrusive.parse('#Logonform');

        $("#Logonform").dialog({
            autoOpen: false,
            modal: true,
            title: 'Login',

            buttons: {
                Save: function () {
                    //alert($('form').serialize());
                    //alert($("#Logonform").attr('UserName'));

                    if ($('form').validate().form()){
                        $.ajax({
                            url: "@Url.Action("LogOn", "Account")",
                            type: "POST",
                            data: $('form').serialize(),
                            datatype: "json",
                            success: function (result) {
                                $("#Logonform").html(result).dialog('open');
                            }
                        });
                    }
                },

                Close: function () {
                    $(this).dialog('close');
                }
            }

        });

        $("#btnDialog").click(function () {
            $.ajax({
                url: "@Url.Action("LogOn", "Account")",
                type: "GET",
                success: function (result) {
                    $("#Logonform").html(result).dialog('open');
                }

                });
        });
    })

&#60;/script&#62;</pre>
<p>As you can see, there is a need to implement</p>
<ul>
<li><span style="color:#808080;">$.validator.unobtrusive.parse(&#8216;#Logonform&#8217;);</span> to activate unobstrusive javascript within the project</li>
<li>include the 2 javascript libraries:</li>
<li><span style="color:#808080;">&#60;script src=&#8221;../../Models/Scripts/jquery.validate.min.js&#8221; type=&#8221;text/javascript&#8221;&#62;&#60;/script&#62; &#60;script src=&#8221;../../Models/Script/jquery.validate.unobtrusive.min.js&#8221; type=&#8221;text/javascript&#8221;&#62;&#60;/script&#62;</span></li>
<li>Before the Ajax call, client validation with <span style="color:#808080;">if ($(&#8216;form&#8217;).validate().form()){ }</span></li>
</ul>
<p><span style="text-decoration:underline;"><strong>Here is the model</strong></span></p>
<pre>    public class LogOnModel
    {
        [Required]
        [Display(Name = "Nom d'utilisateur")]
        public string UserName { get; set; }

        [Required]
        [DataType(DataType.Password)]
        [Display(Name = "Mot de passe")]
        public string Password { get; set; }

        [Display(Name = "MÃ©moriser le mot de passeÂ ?")]
        public bool RememberMe { get; set; }
    }&#60;/</pre>
<p><span style="text-decoration:underline;"><strong>Server validation</strong></span></p>
<p>The server validation is very much straightforward, check if the ModelState is valid, then processing the datas, if error, Add error collection to the ModelState and return back the errors with the partialView</p>
<pre>        [HttpPost]
        public ActionResult LogOn(LogOnModel model)
        {
            if (ModelState.IsValid)
            {
                if (Membership.ValidateUser(model.UserName, model.Password))
                {
                    FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe);
                    return Json( new { result = "ok", user = model.UserName });
                }
                else
                {
                    ModelState.AddModelError("", "Le nom d'utilisateur ou mot de passe fourni est incorrect.");
                }
            }

            // Si nous sommes arrivÃ©s lÃ , quelque chose a Ã©chouÃ©, rÃ©afficher le formulaire
            return PartialView("_Logon");
       }</pre>
<p>Code source can be found here:</p>
<p><a title="JqueryDialogTest.zip" href="http://dl.dropbox.com/u/9847533/JqueryDialogTest.zip">http://dl.dropbox.com/u/9847533/JqueryDialogTest.zip</a></p>
<p>Others interesting articles to read:</p>
<p><a title="Ajax Dialog Form Using jQuery UI" href="http://nickstips.wordpress.com/2011/08/11/asp-net-mvc-ajax-dialog-form-using-jquery-ui/">http://nickstips.wordpress.com/2011/08/11/asp-net-mvc-ajax-dialog-form-using-jquery-ui/</a></p>
<p><a title="Ajax form submission in MVC 3.0" href="http://cdsmithon.net/2012/03/27/ajax-form-submission-in-mvc-3-0/">http://cdsmithon.net/2012/03/27/ajax-form-submission-in-mvc-3-0/</a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[jqTransform plugin issues with JQuery Dialog on Safari, Chrome]]></title>
<link>http://sudhakarmalla.wordpress.com/2011/06/04/jqtransform_on_safari_chrome/</link>
<pubDate>Sat, 04 Jun 2011 06:35:04 +0000</pubDate>
<dc:creator>Sudhakar</dc:creator>
<guid>http://sudhakarmalla.wordpress.com/2011/06/04/jqtransform_on_safari_chrome/</guid>
<description><![CDATA[JQtransform plugin is an amazing way to style your forms. However, there are a few issues using it w]]></description>
<content:encoded><![CDATA[<p>JQtransform plugin is an amazing way to style your forms. However, there are a few issues using it with JQuery dialog (modals or any other JQuery dialog plugins) on Safari and Chrome [ Webkit browsers ] .</p>
<p>The input form components specifically input text , and text area tags are not rendered/jqtransformed properly. The below is how a sample JQtransformed form looks on Safari</p>
<div id="attachment_7" class="wp-caption aligncenter" style="width: 310px"><a href="http://sudhakarmalla.files.wordpress.com/2011/06/picture-4.png"><img class="size-medium wp-image-7" title="JQuery Dialog with JQTransformed form on Safari" src="http://sudhakarmalla.files.wordpress.com/2011/06/picture-4.png?w=300&#038;h=163" alt="JQuery Dialog with JQTransformed form on Safari" width="300" height="163" /></a><p class="wp-caption-text">JQuery Dialog with JQTransformed form on Safari</p></div>
<p>It looks the same way when viewed in Chrome browser too.</p>
<p>The workaround for this problem until JQTransform&#8217;s fix is to tweak the <strong>jquery.jqtransform.js</strong> file. Comment out the below bold code lines in the JS file .</p>
<blockquote><p>/***************************<br />
Text Fields<br />
***************************/<br />
$.fn.jqTransInputText = function(){<br />
return this.each(function(){<br />
var $input = $(this);<br />
&#8230;&#8230;&#8230;&#8230;&#8230;.</p>
<p>&#8230;&#8230;&#8230;&#8230;.<br />
&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;</p>
<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..<br />
/* If this is safari we need to add an extra class */<br />
$.browser.safari &#38;&#38; $wrapper.addClass(&#8216;jqTransformSafari&#8217;);<br />
<em><strong> //comment the below line to fix the Issue related to webkit text box</strong></em><br />
<em><strong>            //$.browser.safari &#38;&#38; $input.css(&#8216;width&#8217;,$wrapper.width()+16);</strong></em><br />
this.wrapper = $wrapper;</p>
<p>});<br />
};</p></blockquote>
<blockquote><p>    /***************************<br />
TextArea<br />
***************************/<br />
$.fn.jqTransTextarea = function(){<br />
return this.each(function(){<br />
var textarea = $(this);<br />
&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.</p>
<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.</p>
<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.</p>
<p>if($.browser.safari){<br />
<strong>//comment the below lines to fix the Issue related to webkit text area</strong><br />
<strong>                //$(&#8216;#jqTransformTextarea-mm&#8217;,oTable)</strong><br />
<strong>                    //.addClass(&#8216;jqTransformSafariTextarea&#8217;)</strong><br />
<strong>                    //.find(&#8216;div&#8217;)</strong><br />
<strong>                        //.css(&#8216;height&#8217;,textarea.height())</strong><br />
<strong>                        //.css(&#8216;width&#8217;,textarea.width())</strong><br />
<strong>                //;</strong><br />
}<br />
});<br />
};</p></blockquote>
<p>The below is how the dialog looks after the modifications</p>
<div id="attachment_8" class="wp-caption aligncenter" style="width: 310px"><a href="http://sudhakarmalla.files.wordpress.com/2011/06/picture-5.png"><img class="size-medium wp-image-8" title="JQuery Dialog with JQTransformed form on Safari after tweaking JS file" src="http://sudhakarmalla.files.wordpress.com/2011/06/picture-5.png?w=300&#038;h=209" alt="JQuery Dialog with JQTransformed form on Safari after tweaking JS file" width="300" height="209" /></a><p class="wp-caption-text">JQuery Dialog with JQTransformed form on Safari after tweaking JS file</p></div>
<p>However, when text area is focused browser&#8217;s default highlighting mars the JQTransform&#8217;s focus style. The work around for this is to add a style class  say &#8220;textArea&#8221; to text area tag and define the style as below in your css file .</p>
<p>.textArea:focus{</p>
<p>outline:none;</p>
<p>}</p>
<p>Finally, the below is how the dialog looks on Safari and Chrome browsers.</p>
<div id="attachment_9" class="wp-caption aligncenter" style="width: 310px"><a href="http://sudhakarmalla.files.wordpress.com/2011/06/picture-6.png"><img class="size-medium wp-image-9" title="It worked !" src="http://sudhakarmalla.files.wordpress.com/2011/06/picture-6.png?w=300&#038;h=202" alt="It worked !" width="300" height="202" /></a><p class="wp-caption-text">It worked !</p></div>
]]></content:encoded>
</item>

</channel>
</rss>
