<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: Custom validation with AJAX</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/custom-validation-with-ajax</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/help/custom-validation-with-ajax/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>jack.doe77 on Custom validation with AJAX</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-validation-with-ajax#p26311</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-validation-with-ajax#p26311</guid>
        	        	<description><![CDATA[<p>Thanks a lot Tony <img class="wp-smiley" src="/blog/wp-includes/images/smilies/icon_smile.gif" alt=":)" /></p>
<p>It&#39;s working now.</p>
]]></description>
        	        	<pubDate>Fri, 06 Apr 2012 07:36:25 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Custom validation with AJAX</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-validation-with-ajax#p26298</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-validation-with-ajax#p26298</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>try to set async: false in ajax.</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit1182' value='Select Code' data-codeid='sfcode1182' /></p>
<div class='sfcode' id='sfcode1182'>
<p>function check_serialNo( value, colname ) {<br /> &#160;&#160;&#160; $.ajax({<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160; url: &#39;<a rel="nofollow" href="http://localhost/hexing/index.php/servis/validate/%27," target="_blank"></a><a href="http://localhost/hexing/index&#038;" rel="nofollow" target="_blank"></a><a href="http://localhost/hexing/index&#038;#038" rel="nofollow" target="_blank">http://localhost/hexing/index&#038;#038</a>;.....te/&#039;,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160; data: { serialNo: value },</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; type: &#39;POST&#39;,</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; async : false,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; datatype: &#39;text&#39;,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160; success: function ( data ) {<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if ( data ) result = [true,""];<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; else result = [false,"Serial number is registered"];<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br /> &#160;&#160;&#160; })<br /> &#160;&#160;&#160; //alert (result);<br /> &#160;&#160;&#160; return result;<br /> };</p>
</div>
<p>Kind Regards</p>
]]></description>
        	        	<pubDate>Thu, 05 Apr 2012 10:37:24 +0300</pubDate>
        </item>
        <item>
        	<title>jack.doe77 on Custom validation with AJAX</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-validation-with-ajax#p26293</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-validation-with-ajax#p26293</guid>
        	        	<description><![CDATA[</p>
<p>Hi All,</p>
<p>I need to validate a field from database to make sure it is not exist.</p>
<p>I&#39;ve tried using editrules custom and create AJAX function to validate.</p>
<p>Here is my code :</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit7814' value='Select Code' data-codeid='sfcode7814' /></p>
<div class='sfcode' id='sfcode7814'>colModel :</div>
<p><input type='button' class='sfcodeselect' name='sfselectit4403' value='Select Code' data-codeid='sfcode4403' /></p>
<div class='sfcode' id='sfcode4403'>{name:&#39;serialNo&#39;, key:true, index:&#39;serialNo&#39;, editable:true, editrules:{required:true,custom:true,custom_func:check_serialNo}, width:88, align:&#34;center&#34;}</div>
<p><input type='button' class='sfcodeselect' name='sfselectit1670' value='Select Code' data-codeid='sfcode1670' /></p>
<div class='sfcode' id='sfcode1670'>AJAX function :</div>
<p><input type='button' class='sfcodeselect' name='sfselectit2920' value='Select Code' data-codeid='sfcode2920' /></p>
<div class='sfcode' id='sfcode2920'>function check_serialNo( value, colname ) {<br /> &#160;&#160;&#160; $.ajax({<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160; url: &#39;<a href="http://localhost/hexing/index.php/servis/validate/&#038;#039" rel="nofollow" target="_blank"><a href="http://localhost/hexing/index" rel="nofollow">http://localhost/hexing/index</a>......&#038;#039</a>;,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160; data: { serialNo: value },<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160; type: &#39;POST&#39;,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160; datatype: &#39;text&#39;,<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160; success: function ( data ) {<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if ( data ) result = [true,&#34;&#34;];<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; else result = [false,&#34;Serial number is registered&#34;];<br /> &#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br /> &#160;&#160;&#160; })<br /> &#160;&#160;&#160; //alert (result);<br /> &#160;&#160;&#160; return result;<br /> };</div>
<p>When I tried to Submit form, I have to click the button twice. Did I missed something ? I have similiar issue with defaultValue from AJAX.</p>
<p>Can someone enlight me ? Thanks.</p></p>
]]></description>
        	        	<pubDate>Wed, 04 Apr 2012 17:34:50 +0300</pubDate>
        </item>
</channel>
</rss>