<?xml version="1.0" encoding="UTF-8"?>
<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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Code &#38; Config - sharing the smart bits &#187; jQuery</title>
	<atom:link href="http://code.lewro.com/category/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://code.lewro.com</link>
	<description>Code &#38; Config - sharing the smart bits</description>
	<lastBuildDate>Sun, 22 Jan 2012 13:30:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Objects in javascript / jquery / caffeescript</title>
		<link>http://code.lewro.com/jquery/objects-in-javascript-jquery-caffeescript/</link>
		<comments>http://code.lewro.com/jquery/objects-in-javascript-jquery-caffeescript/#comments</comments>
		<pubDate>Sat, 16 Jul 2011 11:12:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://code.lewro.com/?p=236</guid>
		<description><![CDATA[Here is one of the way you can declare objects in javascript, using the caffeescript syntax. We are using javascript object litera in here. // This replaces the onload $ -&#62; //Object name (does not have to be capitalize, we are not using constructor core = // Method name init: -&#62; // Using @ is [...]]]></description>
			<content:encoded><![CDATA[<p>Here is one of the way you can declare objects in javascript, using the caffeescript syntax. We are using javascript object litera in here. </p>
<pre class="brush: jscript;">
// This replaces the onload
$ -&gt;

  //Object name (does not have to be capitalize, we are not using constructor
  core =
    // Method name
    init: -&gt;
      // Using @ is replacement for this.modules
      @modules = new Array()

    register: (module) -&gt;
      @modules.push(module)
</pre>
]]></content:encoded>
			<wfw:commentRss>http://code.lewro.com/jquery/objects-in-javascript-jquery-caffeescript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Each loop in jQuery which only follows certain elements</title>
		<link>http://code.lewro.com/jquery/each-loop-in-jquery-which-only-follows-certain-elements/</link>
		<comments>http://code.lewro.com/jquery/each-loop-in-jquery-which-only-follows-certain-elements/#comments</comments>
		<pubDate>Thu, 23 Jun 2011 15:59:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://code.lewro.com/?p=234</guid>
		<description><![CDATA[This is a function I am using in my application so I could use keyboard keys to browse through a lit of tasks. My problem was that som of the tasks were hidden (in my example did not have the class &#8220;visible&#8221;) so I did not want to go through them when using the up [...]]]></description>
			<content:encoded><![CDATA[<p>This is a function I am using in my application so I could use keyboard keys to browse through a lit of tasks. My problem was that som of the tasks were hidden (in my example did not have the class &#8220;visible&#8221;) so I did not want to go through them when using the up and down keys while browsing the list of tasks.  I only wanted to use click() on the next visible list item.</p>
<p>I had to use  prevAll() &#038; nextAll with a specific slection of a class &#8216;visible&#8217; but and reaching for the first match.<br />
This the particular piece of code in caffeescript (again, its just jquery without brackets)</p>
<pre class="brush: jscript;">
  prev_list = $(current_list).prevAll('li.visible:first')
</pre>
<p>My function is a bit longer as I am checking by other stuff but this is the simplified version of it. </p>
<pre class="brush: jscript;">
focus_on_prev_task = -&gt;
    $('#data_ajax_cover li').each -&gt;
      current_list = $(this)
      prev_list = $(current_list).prevAll('li.visible:first')
      $(prev_list).click()
</pre>
]]></content:encoded>
			<wfw:commentRss>http://code.lewro.com/jquery/each-loop-in-jquery-which-only-follows-certain-elements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Catch the ajax:beforeSend and ajax:success on rails 3.1 remote forms with cafeescript</title>
		<link>http://code.lewro.com/jquery/catch-the-ajaxbeforesend-and-ajaxsuccess-on-rails-3-1-remote-forms-with-cafeescript/</link>
		<comments>http://code.lewro.com/jquery/catch-the-ajaxbeforesend-and-ajaxsuccess-on-rails-3-1-remote-forms-with-cafeescript/#comments</comments>
		<pubDate>Tue, 21 Jun 2011 11:58:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://code.lewro.com/?p=232</guid>
		<description><![CDATA[You might want to display your custom progress bar when using remote ajax forms in rails 3.1. This is how you would bind your custom functions to the events in cafeescript rails_remote_forms = -&#62; $('form[data-remote]').bind &#34;ajax:beforeSend&#34;, -&#62; ajax_display_progress_bar() $('form[data-remote]').bind &#34;ajax:success&#34;, -&#62; ajax_success_message()]]></description>
			<content:encoded><![CDATA[<p>You might want to display your custom progress bar when using remote ajax forms in rails 3.1. This is how you would bind your custom functions to the events in cafeescript</p>
<pre class="brush: jscript;">
  rails_remote_forms = -&gt;
    $('form[data-remote]').bind &quot;ajax:beforeSend&quot;, -&gt;
      ajax_display_progress_bar()
    $('form[data-remote]').bind &quot;ajax:success&quot;, -&gt;
     ajax_success_message()
</pre>
]]></content:encoded>
			<wfw:commentRss>http://code.lewro.com/jquery/catch-the-ajaxbeforesend-and-ajaxsuccess-on-rails-3-1-remote-forms-with-cafeescript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Turn autocomplete off on all forms</title>
		<link>http://code.lewro.com/jquery/turn-autocomplete-off-on-all-forms/</link>
		<comments>http://code.lewro.com/jquery/turn-autocomplete-off-on-all-forms/#comments</comments>
		<pubDate>Wed, 15 Jun 2011 20:37:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://code.lewro.com/?p=229</guid>
		<description><![CDATA[When autosuggestions are turning off the focus I got rid of them like this. The script is in caffeescript but pure jQuery is not much different #Turn autocomplete off on all forms # ============================================================================ turn_autocomplete_off = -&#62; $('form').each -&#62; $(this).attr('autocomplete', 'off') $(this).find('input').attr('autocomplete', 'off')]]></description>
			<content:encoded><![CDATA[<p>When autosuggestions are turning off the focus I got rid of them like this.<br />
The script is in caffeescript but pure jQuery is not much different</p>
<pre class="brush: jscript;">
  #Turn autocomplete off on all forms
  # ============================================================================
  turn_autocomplete_off = -&gt;
    $('form').each -&gt;
      $(this).attr('autocomplete', 'off')
      $(this).find('input').attr('autocomplete', 'off')
</pre>
]]></content:encoded>
			<wfw:commentRss>http://code.lewro.com/jquery/turn-autocomplete-off-on-all-forms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Function in Caffee Script</title>
		<link>http://code.lewro.com/jquery/function-in-caffee-script/</link>
		<comments>http://code.lewro.com/jquery/function-in-caffee-script/#comments</comments>
		<pubDate>Fri, 10 Jun 2011 12:33:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://code.lewro.com/?p=227</guid>
		<description><![CDATA[Caffee Script has become the default in rails 3.1 The syntax is pretty interesting and for those of you who do not like the brackets it is going to be a gogo. You only need to make sure that your indenting is correct This is how you define a simple function my_lovely_function = -&#62; alert [...]]]></description>
			<content:encoded><![CDATA[<p>Caffee Script has become the default in rails 3.1<br />
The syntax is pretty interesting and for those of you who do not like the brackets it is going to be a gogo.<br />
You only need to make sure that your indenting is correct </p>
<p>This is how you define a simple function</p>
<pre class="brush: jscript;">
my_lovely_function = -&gt;
 alert &quot;hello&quot;
</pre>
<p>This is how you define a simple function with a variable</p>
<pre class="brush: jscript;">
my_lovely_function = (variable) -&gt;
 alert &quot;hello&quot;
</pre>
<p>And this is how you call the function </p>
<pre class="brush: jscript;">
my_lovely_function variable
</pre>
<p>As you can see most of the brackets are gone. You can still use jQuery in Caffee Script. jQuery is part of Rails 3.1 as well  so we are all good <img src='http://code.lewro.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://code.lewro.com/jquery/function-in-caffee-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redo your &#8220;hover&#8221; events for jQuery 1.5.x</title>
		<link>http://code.lewro.com/jquery/redo-your-hover-events-for-jquery-1-5-x/</link>
		<comments>http://code.lewro.com/jquery/redo-your-hover-events-for-jquery-1-5-x/#comments</comments>
		<pubDate>Sat, 23 Apr 2011 14:59:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://code.lewro.com/?p=223</guid>
		<description><![CDATA[The new jQuery >1.5.0 does not support the syntax for the hover we have been using so far but there is a better way. This was the old way. $('#users_edit p.edit_in_place_paragraph').live('hover', function (ev) { if (ev.type == 'mouseover') { // your on hover stuff.. } if (ev.type == 'mouseout') { // your hover out stuff.... [...]]]></description>
			<content:encoded><![CDATA[<p>The new jQuery >1.5.0 does not support the syntax for the hover we have been using so far but there is a better way. </p>
<p>This was the old way.</p>
<pre class="brush: jscript;">
	$('#users_edit p.edit_in_place_paragraph').live('hover', function (ev) {
		if (ev.type == 'mouseover') {
          // your on hover stuff..
		}
		if (ev.type == 'mouseout') {
          // your hover out stuff....
		}
	});
</pre>
<p>This is the new way, which works.</p>
<pre class="brush: jscript;">
  $('#users_edit p.edit_in_place_paragraph').live({
    mouseenter:
       function()
       {
          // your on hover stuff..
       },
    mouseleave:
       function()
       {
          // your hover out stuff....
       }
    });
</pre>
]]></content:encoded>
			<wfw:commentRss>http://code.lewro.com/jquery/redo-your-hover-events-for-jquery-1-5-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Checking the value of empty cookie in different browsers</title>
		<link>http://code.lewro.com/jquery/checking-the-value-of-empty-cookie-in-different-browsers/</link>
		<comments>http://code.lewro.com/jquery/checking-the-value-of-empty-cookie-in-different-browsers/#comments</comments>
		<pubDate>Sun, 26 Dec 2010 23:07:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://code.lewro.com/?p=212</guid>
		<description><![CDATA[Just a mental note for the small issue I have find out when working with cookies. During the testing of my latest app. I have realized that there IE7/8 will return null and Firefox will return empty string when you request the value of empty cookie. You might need to check for both cases when [...]]]></description>
			<content:encoded><![CDATA[<p>Just a mental note for the small issue I have find out when working with cookies.<br />
During the testing of my latest app. I have realized that there IE7/8 will return null and Firefox will return empty string when you request the value of empty cookie. You might need to check for both cases when doing this kind of checking.</p>
<h3>Why would you ever wanted to do this?</h3>
<p>In my example I set certain preferences on the site into the cookie. Once the user loggs out the cookie is destroyed. I need to say that this is session cookie so it will also get destroyed when the user closes the browser. </p>
<p>My scripts checks the value of the cookie and the page behaves differently if the depending of the cookie. If the cookie&#8217;s value is null, empty string or undefined I want the page to behave using default scenario. </p>
]]></content:encoded>
			<wfw:commentRss>http://code.lewro.com/jquery/checking-the-value-of-empty-cookie-in-different-browsers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery slideshow with Next &amp; Previous buttons</title>
		<link>http://code.lewro.com/jquery/jquery-slideshow-with-next-previous-buttons/</link>
		<comments>http://code.lewro.com/jquery/jquery-slideshow-with-next-previous-buttons/#comments</comments>
		<pubDate>Sat, 09 Oct 2010 12:01:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://code.lewro.com/?p=202</guid>
		<description><![CDATA[I have just recently implemented this slide show to one of my clients so I thought why not to share it with you guys. The sideshow is again quite flexible. It should be able to slide any kind of elements you specify in $elements variable. It is up to you. It could be images, div [...]]]></description>
			<content:encoded><![CDATA[<p>I have just recently implemented this slide show to one of my clients so I thought why not to share it with you guys. </p>
<p>The sideshow is again quite flexible. It should be able to slide any kind of elements you specify in $elements variable. It is up to you. It could be images, div with css background images, list items with text only and so on. </p>
<p>You can set the hide and show intervals use the variables $hideInterval, $showInterval. The navigation which allows you to click previous and next is inserted into the DOM after the page is loaded. You will need to specify the html element in the variable $insert_nav. If you look close the nav will be inserted before this element insertBefore($insert_nav) but you could just simply change this to insertAfter() if you need to.</p>
<p>You could also change the effects inside the function from &#8220;fadeIn()&#8221; to &#8220;show()&#8221; and so on.</p>
<pre class="brush: jscript;">
// Slideshow of the board
$(function () {

    $insert_nav = $('#board_one');

    //Insert Nav into the DOM
    $('&lt;ul id=&quot;board_nav&quot;&gt;&lt;li id=&quot;previous&quot; title=&quot;previous&quot;&gt;previous&lt;/li&gt;&lt;li id=&quot;next&quot; title=&quot;next&quot;&gt;next&lt;/li&gt;&lt;/ul&gt;').insertBefore($insert_nav);

    $elements = $('.board_element');
    $elementsSize = $($elements).length;

    // Setting the intervals for animation
    $n=0;
    $interval = 5000;
    $hideInterval = 30;
    $showInterval = 500;
    $stop = false;

    loopelements();

    // Loop through elements
    function loopelements (){

        if ($stop == 'next'){
            if($n == $elementsSize){
                $n = 0;
            }
            $($elements).fadeOut($hideInterval);
            $($elements[$n]).fadeIn($showInterval);
        }else if ($stop == 'prev'){
            if($n == -1) {
                $n = $elementsSize -1;
            }
            $($elements).fadeOut($hideInterval);
            $($elements[$n]).fadeIn($showInterval);
        }else {
            $($elements).fadeOut($hideInterval);
            $($elements[$n] ).fadeIn($showInterval);
            $n++;

            if($n == $elementsSize) $n = 0;
            setTimeout(loopelements,$interval);
        }
    }

    // Next button
    $('#next').live('click', function (){
        $n++;
        $stop = 'next';
        $(this).stop(true,true);
        loopelements();
    });

    // Prev button
    $('#previous').live('click', function (){
        $n--;
        $stop = 'prev';
        $(this).stop(true,true);
        loopelements();
    });
});
</pre>
]]></content:encoded>
			<wfw:commentRss>http://code.lewro.com/jquery/jquery-slideshow-with-next-previous-buttons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to submit form using AJAX when the form data are changed?</title>
		<link>http://code.lewro.com/jquery/how-to-submit-form-using-ajax-when-form-data-are-changed/</link>
		<comments>http://code.lewro.com/jquery/how-to-submit-form-using-ajax-when-form-data-are-changed/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 15:21:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://code.lewro.com/?p=192</guid>
		<description><![CDATA[I have build simple function which helps me to make my code nice and clean as well as to have general solution for &#8220;on_change&#8221; AJAX submit. I have named the function q_submit_ajax_on_change with q in the front because I use it in my quantify project. The function uses another pre-build function called q_submit_ajax_on_change which I [...]]]></description>
			<content:encoded><![CDATA[<p>I have build simple function which helps me to make my code nice and clean as well as to have general solution for &#8220;on_change&#8221; AJAX submit. I have named the function q_submit_ajax_on_change with q in the front because I use it in my  quantify project. The function uses another pre-build function  called q_submit_ajax_on_change which I will describe next. You  called this function from anywhere you have your form which should be submitted via AJAX. You need to pass the element (input or textarea) which will be controlled by this function. The function basically checks the value of the element and if the value has changed then the data are submitted via AJAX on blur, which means when the user leaves the element. </p>
<pre class="brush: jscript;">
function q_submit_ajax_on_change ($element, $form){
	$($element).live('focus', function(){
		$characters = $(this).attr('value');
	});

	$($element).live('blur', function(){
		$current_characters = $(this).attr('value');

		if($characters == $current_characters){
			// No change ....
		}else{
			// Submit the Form when the user looses focus
			q_ajax_form_submit($form, $('#system_message'));
		}
	});
}
</pre>
<p>The data are submitted using the q_ajax_form_submit function which I have also build for quantify project. It requires 2 variables, form and the id of the element where the success  or failure message should be displayed.  This function uses the basic jQuery Ajax function but on top displays the progress bar (handled by q_display_progress_bar() function and displays custom success and failure messages, using functions &#8211; q_display_success_message() and q_display_failure_message(). </p>
<pre class="brush: jscript;">
function q_ajax_form_submit (form, message_box){

	q_display_progress_bar();

	$form = form
	$url = $form.attr('action');
	$dataString = $form.serialize();	

	$.ajax({
		type: &quot;POST&quot;,
		url: $url,
		data: $dataString,
		success: function (data) {
			q_display_success_message();

			// Return the data as well
			$(message_box).html(data);
		},
		error: function () {
			q_display_failure_message();
		}
    });
}
</pre>
<p>This is my basic framework for the AJAX calls. Here are the last three functions mentioned before. </p>
<p>Function q_display_progress_bar basically inserts animated gift which  is specified as background css image for ajax_loader id. You can see this loader is inserted before id called content. We could also specify variable instead of id directly as I have done in my case. </p>
<p>Function q_display_success_message is pretty specific for my case where I have decided to insert the &#8220;Saved&#8221; image into the page and fade it out. You can see that I remove the animated loader from the page before I insert the &#8220;saved&#8221; image. </p>
<p>The q_display_failure_message is doing basically the same what the success function but is using one more additional function which scrolls the page to the top. q_scroll_top(110,250) as well as inserts the black overlay using function q_insert_overlay(&#8216;body&#8217;).  </p>
<pre class="brush: jscript;">
function q_display_progress_bar (){
	// Display animation during the ajax call
	$('&lt;span id=&quot;ajax_loader&quot;&gt;&lt;/span&gt;').insertBefore('#content');
}

function q_display_success_message (){
	// Display &quot;Saved&quot; message when ajax returns success
	$('#ajax_loader').remove();
	$('&lt;span class=&quot;saved&quot;&gt;Saved&lt;/span&gt;').insertBefore('#content');
	$('.saved').hide().fadeIn(500).delay(1000).fadeOut(500);

	setTimeout(function(){
		$('.saved').remove();
	},2000);
}

function q_display_failure_message (){
	// Display &quot;Failure&quot; message when ajax returns failure
	$('#ajax_loader').remove();

	// Insert Overlay background
	q_insert_overlay('body');

	$('&lt;span class=&quot;failure&quot;&gt;There has been problem. Some of data might not be saved.&lt;span id=&quot;small_close&quot;&gt;close&lt;/span&gt;&lt;span id=&quot;big_close&quot;&gt;Close&lt;/span&gt;&lt;/span&gt;').insertBefore('#content');
	$('.saved').hide().fadeIn(500);

	// Scroll the view point
	q_scroll_top(110,250);
}
</pre>
<p>So here are the last two functions. These are visual functions so you do not need to use them and they might not be the right solution in your case. I have specified semi transparent background css image for popup_cover which brings the black overlay on top of which the Ajax messages are positioned. </p>
<pre class="brush: jscript;">
function q_insert_overlay($body){
	// Inserts the overlay into the page
	$window_height = $($body).height();
	$('&lt;div id=&quot;popup_cover&quot;&gt;&lt;/di&gt;').insertBefore($('#page'));

	$('#popup_cover').css({
		'height': $window_height
	});
}

function q_scroll_top ($top, $time){
	$('html, body').animate({
		scrollTop: $top
	}, $time);
}
</pre>
<p>And this is it. This brings modern web application into the life where pages do not have to be reloaded and consume users time so user can focus more on the core of her/his work. </p>
]]></content:encoded>
			<wfw:commentRss>http://code.lewro.com/jquery/how-to-submit-form-using-ajax-when-form-data-are-changed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery email form validation for forms with multiple email addresses</title>
		<link>http://code.lewro.com/jquery/jquery-email-form-validation-for-forms-with-multiple-email-addresses/</link>
		<comments>http://code.lewro.com/jquery/jquery-email-form-validation-for-forms-with-multiple-email-addresses/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 01:03:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://code.lewro.com/?p=134</guid>
		<description><![CDATA[  ]]></description>
			<content:encoded><![CDATA[<p>Based on user statistics, users prefer to have the form validated as they type so they do not have to come back and correct stuff after they submitted the whole form. In our example I will show you how to validate the form with multiple email addresses. You can start by defining CSS class called &#8220;incorrect_email&#8221; where you define how the input field should look like when the validation fails. I can imagine you will define something like this.</p>
<pre class="brush: css;">
.incorrect_email {
  border: 1px solid red;
  background: pink;
  color: red;
}
</pre>
<p>After this we will  create jQuery script which will validates every input field which has assigned class &#8220;email_validation&#8221;. This could be done in so many ways but I have chosen this for its simplicity.  The key here is to user blur() function to validate the input field right after the user leaves the field and it does not matter if its by pressing TAB or clicking with mouse.</p>
<pre class="brush: jscript;">

$('form input').blur(

  // check the input fields which has a class email_validation as we expect more email fields in the form
  if($(this).hasClass('email_validation')){

   // get the current value
    var email = $(this).val();

    // define regular expression for email
    var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

    // validate the email address
    if(!filter.test(email)){

      // email incorrect add the class &quot;incorrect_email&quot;
      $(this).addClass(&quot;incorrect_email&quot;)

    // email corrected remove the class &quot;incorrect_email&quot;
    }else if(filter.test(email)){

      // you could also check in this point if the the input has already the class...
      $(this).removeClass(&quot;incorrect_email&quot;);
    }
  }
);
</pre>
<p>This can be quite handy if you have forms with multiple fields and few of them are email type (for example: inviting your contacts). You might also need to do some other type of validations like if the fields are empty and so on, this is just a part of your validation function.</p>
]]></content:encoded>
			<wfw:commentRss>http://code.lewro.com/jquery/jquery-email-form-validation-for-forms-with-multiple-email-addresses/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

