<?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: jQuery remote form validation</title>
	<atom:link href="http://www.opencoder.co.uk/2010/07/jquery-remote-form-validation/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.opencoder.co.uk/2010/07/jquery-remote-form-validation/</link>
	<description>Helping the fellow geek</description>
	<lastBuildDate>Fri, 07 Oct 2011 08:49:33 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: some guy</title>
		<link>http://www.opencoder.co.uk/2010/07/jquery-remote-form-validation/comment-page-1/#comment-3528</link>
		<dc:creator>some guy</dc:creator>
		<pubDate>Fri, 07 Oct 2011 02:01:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.opencoder.co.uk/?p=260#comment-3528</guid>
		<description>This is a great example, thanks</description>
		<content:encoded><![CDATA[<p>This is a great example, thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris McDonald</title>
		<link>http://www.opencoder.co.uk/2010/07/jquery-remote-form-validation/comment-page-1/#comment-3224</link>
		<dc:creator>Chris McDonald</dc:creator>
		<pubDate>Wed, 31 Aug 2011 11:13:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.opencoder.co.uk/?p=260#comment-3224</guid>
		<description>I&#039;ve never experienced a problem with remote validation timing out. That&#039;s a server side issue, but it makes sense that the validation won&#039;t get triggered if the async attribute is set to false, since it will wait for the server to respond. With async false the validation is basically blocked until the remote validation request gets a response. You will need to sort out the reason why the request is timing out or failing, these remote validation requests should really only take a second or two to run, anything longer I think is a usability issue.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve never experienced a problem with remote validation timing out. That&#8217;s a server side issue, but it makes sense that the validation won&#8217;t get triggered if the async attribute is set to false, since it will wait for the server to respond. With async false the validation is basically blocked until the remote validation request gets a response. You will need to sort out the reason why the request is timing out or failing, these remote validation requests should really only take a second or two to run, anything longer I think is a usability issue.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian</title>
		<link>http://www.opencoder.co.uk/2010/07/jquery-remote-form-validation/comment-page-1/#comment-3223</link>
		<dc:creator>Christian</dc:creator>
		<pubDate>Wed, 31 Aug 2011 10:35:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.opencoder.co.uk/?p=260#comment-3223</guid>
		<description>Hi! I have a similar solution, and when the remote validation time out or aborts, the form gets unsubmitable. Validation is still on, but the remote validation doesnt get triggered when I change the field value or submits the form again.
Anyone experienced this problem?

-C</description>
		<content:encoded><![CDATA[<p>Hi! I have a similar solution, and when the remote validation time out or aborts, the form gets unsubmitable. Validation is still on, but the remote validation doesnt get triggered when I change the field value or submits the form again.<br />
Anyone experienced this problem?</p>
<p>-C</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris McDonald</title>
		<link>http://www.opencoder.co.uk/2010/07/jquery-remote-form-validation/comment-page-1/#comment-2911</link>
		<dc:creator>Chris McDonald</dc:creator>
		<pubDate>Fri, 22 Jul 2011 11:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.opencoder.co.uk/?p=260#comment-2911</guid>
		<description>Ah I see, I&#039;ve never used CodeIgniter before, that function invocation sounds like fun. I&#039;m not sure what to suggest then apart from putting log statements on the server side and using a tool like firebug or chrome developer tools to see if the remote validation request is actually taking place. You can see in the network section the requests being made and you can check the response body only contains the text &#039;true&#039;.
Thanks for the nice comments, I&#039;m glad the site is useful, I wish I had more time to make more posts but am really busy with work. I&#039;ll make an extra effort to post more regularly!</description>
		<content:encoded><![CDATA[<p>Ah I see, I&#8217;ve never used CodeIgniter before, that function invocation sounds like fun. I&#8217;m not sure what to suggest then apart from putting log statements on the server side and using a tool like firebug or chrome developer tools to see if the remote validation request is actually taking place. You can see in the network section the requests being made and you can check the response body only contains the text &#8216;true&#8217;.<br />
Thanks for the nice comments, I&#8217;m glad the site is useful, I wish I had more time to make more posts but am really busy with work. I&#8217;ll make an extra effort to post more regularly!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin</title>
		<link>http://www.opencoder.co.uk/2010/07/jquery-remote-form-validation/comment-page-1/#comment-2904</link>
		<dc:creator>Kevin</dc:creator>
		<pubDate>Fri, 22 Jul 2011 01:21:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.opencoder.co.uk/?p=260#comment-2904</guid>
		<description>Thanks for supporting but it&#039;s not work  T_T
I&#039;m using CodeIgniter Framework (www.codeigniter.com) so when i call URL following SITE_URL + &#039;admin/user/checkUser&#039; then function checkUser will automatically invoke
Now, i have finished that project by using another way not jquery validate, i still try to find out Jquery validate integrate with CodeIgniter.
By the way, your blog is so cool, i have learned many thing from this site. Thanks</description>
		<content:encoded><![CDATA[<p>Thanks for supporting but it&#8217;s not work  T_T<br />
I&#8217;m using CodeIgniter Framework (www.codeigniter.com) so when i call URL following SITE_URL + &#8216;admin/user/checkUser&#8217; then function checkUser will automatically invoke<br />
Now, i have finished that project by using another way not jquery validate, i still try to find out Jquery validate integrate with CodeIgniter.<br />
By the way, your blog is so cool, i have learned many thing from this site. Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris McDonald</title>
		<link>http://www.opencoder.co.uk/2010/07/jquery-remote-form-validation/comment-page-1/#comment-2814</link>
		<dc:creator>Chris McDonald</dc:creator>
		<pubDate>Wed, 13 Jul 2011 07:58:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.opencoder.co.uk/?p=260#comment-2814</guid>
		<description>The problem appears to be the PHP file, which just has a function named checkUser. Before I assumed that your remote URL was being rewritten on the server to be directed to the correct PHP code, but if this is not the case then you need to refer directly to a PHP file itself and not a function inside the php file.
So if the php file is called checkUser.php and located inside the /admin/user/ directory your remote validation url would be SITE_URL + &#039;/admin/user/checkUser.php&#039;

Also inside the php file you can&#039;t just have a function, but if you do it needs to be invoked. If that is all the php file contains the function is unnecessary, but for reference if you use a function you need to invoke it.
[code lang=&quot;php&quot;]
function checkUser() {
    echo &quot;true&quot;;
}
checkUser();
[/code]

Hope this helps.</description>
		<content:encoded><![CDATA[<p>The problem appears to be the PHP file, which just has a function named checkUser. Before I assumed that your remote URL was being rewritten on the server to be directed to the correct PHP code, but if this is not the case then you need to refer directly to a PHP file itself and not a function inside the php file.<br />
So if the php file is called checkUser.php and located inside the /admin/user/ directory your remote validation url would be SITE_URL + &#8216;/admin/user/checkUser.php&#8217;</p>
<p>Also inside the php file you can&#8217;t just have a function, but if you do it needs to be invoked. If that is all the php file contains the function is unnecessary, but for reference if you use a function you need to invoke it.</p>
<div class="codesnip-container" >
<div class="php codesnip" style="font-family:monospace;"><span class="kw2">function</span> checkUser<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">echo</span> <span class="st0">&quot;true&quot;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
checkUser<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</div>
<p>Hope this helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin</title>
		<link>http://www.opencoder.co.uk/2010/07/jquery-remote-form-validation/comment-page-1/#comment-2804</link>
		<dc:creator>Kevin</dc:creator>
		<pubDate>Mon, 11 Jul 2011 16:59:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.opencoder.co.uk/?p=260#comment-2804</guid>
		<description>Thank for your support.
This is my code detail.
HTML:
[code lang=&quot;javascript&quot;]



[/code]

JS:
[code lang=&quot;javascript&quot;]
$(&quot;#myform&quot;).validate({
                rules: {                                          
                    username:{   
                        remote: {
                            url: SITE_URL + &#039;/admin/user/checkUser&#039;,
                            type: &#039;POST&#039;,
                            async: false,
                            data: {
                                username: function() {
                                    return $(&quot;#username&quot;).val();
                                }
                            }                                                                                            
                        }                        
                    }
                },
                messages: {
                    username: { remote: &quot;Already subscribed&quot;}
                }                                                       
            });
[/code]

PHP:
i just echo &quot;true&quot;. That&#039;s all!
[code lang=&quot;javascript&quot;]
function checkUser() {
        echo &quot;true&quot;;
    }
[/code]</description>
		<content:encoded><![CDATA[<p>Thank for your support.<br />
This is my code detail.<br />
HTML:</p>
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;">&nbsp;</div>
</div>
<p>JS:</p>
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;">$<span class="br0">&#40;</span><span class="st0">&quot;#myform&quot;</span><span class="br0">&#41;</span>.<span class="me1">validate</span><span class="br0">&#40;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rules<span class="sy0">:</span> <span class="br0">&#123;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; username<span class="sy0">:</span><span class="br0">&#123;</span> &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; remote<span class="sy0">:</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; url<span class="sy0">:</span> SITE_URL <span class="sy0">+</span> <span class="st0">&#8216;/admin/user/checkUser&#8217;</span><span class="sy0">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; type<span class="sy0">:</span> <span class="st0">&#8216;POST&#8217;</span><span class="sy0">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; async<span class="sy0">:</span> <span class="kw2">false</span><span class="sy0">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; data<span class="sy0">:</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; username<span class="sy0">:</span> <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> $<span class="br0">&#40;</span><span class="st0">&quot;#username&quot;</span><span class="br0">&#41;</span>.<span class="me1">val</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="sy0">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; messages<span class="sy0">:</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; username<span class="sy0">:</span> <span class="br0">&#123;</span> remote<span class="sy0">:</span> <span class="st0">&quot;Already subscribed&quot;</span><span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</div>
<p>PHP:<br />
i just echo &#8220;true&#8221;. That&#8217;s all!</p>
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;"><span class="kw2">function</span> checkUser<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; echo <span class="st0">&quot;true&quot;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris McDonald</title>
		<link>http://www.opencoder.co.uk/2010/07/jquery-remote-form-validation/comment-page-1/#comment-2782</link>
		<dc:creator>Chris McDonald</dc:creator>
		<pubDate>Sat, 09 Jul 2011 09:44:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.opencoder.co.uk/?p=260#comment-2782</guid>
		<description>Ok, as far as I can tell that code looks ok, for it to work the following things need to be correct. You have a form with an input field with name &#039;username&#039; which also has id of &#039;username&#039;. You have some script running at your site url which returns a string &#039;true&#039; or &#039;false&#039;. I noticed you didn&#039;t have a .php extension on that url, I assume there is some url rewriting going on.
Can I ask is the form actually validating and the username showing up as invalid? Is it just the message you specified not showing up? Try adding some log statements, both in your javascript username function (use console.log() and check with firebug or chrome developer tools) and in your server side script to check that both are being called.
Other than that I don&#039;t think I can help without seeing the complete form html and the complete javascript validation code.
By the way I have a code highlight plugin installed on this site. You can use it in comment posts, e.g.
&#091;code lang=&quot;javascript&quot;&#093;
$(document).ready(function(){
    console.log(&quot;Document is ready&quot;);
});
&#091;/code&#093;
Becomes:
[code lang=&quot;javascript&quot;]
$(document).ready(function(){
    console.log(&quot;Document is ready&quot;);
});
[/code]</description>
		<content:encoded><![CDATA[<p>Ok, as far as I can tell that code looks ok, for it to work the following things need to be correct. You have a form with an input field with name &#8216;username&#8217; which also has id of &#8216;username&#8217;. You have some script running at your site url which returns a string &#8216;true&#8217; or &#8216;false&#8217;. I noticed you didn&#8217;t have a .php extension on that url, I assume there is some url rewriting going on.<br />
Can I ask is the form actually validating and the username showing up as invalid? Is it just the message you specified not showing up? Try adding some log statements, both in your javascript username function (use console.log() and check with firebug or chrome developer tools) and in your server side script to check that both are being called.<br />
Other than that I don&#8217;t think I can help without seeing the complete form html and the complete javascript validation code.<br />
By the way I have a code highlight plugin installed on this site. You can use it in comment posts, e.g.<br />
&#91;code lang=&#8221;javascript&#8221;&#93;<br />
$(document).ready(function(){<br />
    console.log(&#8220;Document is ready&#8221;);<br />
});<br />
&#91;/code&#93;<br />
Becomes:</p>
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;">$<span class="br0">&#40;</span>document<span class="br0">&#41;</span>.<span class="me1">ready</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; console.<span class="me1">log</span><span class="br0">&#40;</span><span class="st0">&quot;Document is ready&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin</title>
		<link>http://www.opencoder.co.uk/2010/07/jquery-remote-form-validation/comment-page-1/#comment-2778</link>
		<dc:creator>Kevin</dc:creator>
		<pubDate>Sat, 09 Jul 2011 04:23:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.opencoder.co.uk/?p=260#comment-2778</guid>
		<description>my function checkUser just echo &quot;false&quot;;
But message for remote is not show. :(</description>
		<content:encoded><![CDATA[<p>my function checkUser just echo &#8220;false&#8221;;<br />
But message for remote is not show. <img src='http://www.opencoder.co.uk/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin</title>
		<link>http://www.opencoder.co.uk/2010/07/jquery-remote-form-validation/comment-page-1/#comment-2777</link>
		<dc:creator>Kevin</dc:creator>
		<pubDate>Sat, 09 Jul 2011 04:19:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.opencoder.co.uk/?p=260#comment-2777</guid>
		<description>Thanks for greate tut!
I&#039;m trying use Jqurey validate for option remote following code below
username:{   
                        remote: {
                            url: SITE_URL + &#039;/admin/user/checkUser&#039;,
                            type: &#039;POST&#039;,
                            async: false,
                            data: {
                                username: function() {
                                    return $(&quot;#username&quot;).val();
                                }
                            }                                                                                            
                        }                        
                    }
and this message
messages: {
                    username: { remote: &quot;Already subscribed&quot;}
                }
but it doesn&#039;t work. Please help me. I dont know how it doesnt work
Sorry for my english.</description>
		<content:encoded><![CDATA[<p>Thanks for greate tut!<br />
I&#8217;m trying use Jqurey validate for option remote following code below<br />
username:{<br />
                        remote: {<br />
                            url: SITE_URL + &#8216;/admin/user/checkUser&#8217;,<br />
                            type: &#8216;POST&#8217;,<br />
                            async: false,<br />
                            data: {<br />
                                username: function() {<br />
                                    return $(&#8220;#username&#8221;).val();<br />
                                }<br />
                            }<br />
                        }<br />
                    }<br />
and this message<br />
messages: {<br />
                    username: { remote: &#8220;Already subscribed&#8221;}<br />
                }<br />
but it doesn&#8217;t work. Please help me. I dont know how it doesnt work<br />
Sorry for my english.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

