<?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: Need help on jquery validationengine plugin  </title>
	<link>http://www.trirand.com/blog/?page_id=393/help/need-help-on-jquery-validationengine-plugin</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/need-help-on-jquery-validationengine-plugin/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Nandish on Need help on jquery validationengine plugin  </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/need-help-on-jquery-validationengine-plugin#p21924</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/need-help-on-jquery-validationengine-plugin#p21924</guid>
        	        	<description><![CDATA[<p>Hi,</p>
</p>
<p>I m using jquery validationengine plugin in jqgrid to validate each fileds while adding and editing fields, its working fine but the thing is it will submit the form&#160; please lookout this code and help me out on this</p>
<p>jQuery(document).ready(function(){<br />jQuery("#list").jqGrid({<br />url:&#39;server.php&#39;,<br />datatype: "json",<br />mtype: &#39;POST&#39;,</p>
<p>colNames:[&#39;Sap Id&#39;,&#39;Emp ID&#39;,&#39;Employee Name&#39;,&#39;Roles&#39;,&#39;Location&#39;,&#39;Group Name&#39;,&#39;Email&#39;],<br />colModel:[<br />&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;sap_id&#39;, index:&#39;sap_id&#39;, width:20, align:&#39;left&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; searchoptions:{sopt:[&#39;eq&#39;, &#39;ne&#39;,&#39;cn&#39;,&#39;nc&#39;]},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; editable:true</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; },</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;emp_id&#39;, index:&#39;emp_id&#39;, width: 40, align:&#39;left&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; searchoptions:{sopt:[&#39;eq&#39;, &#39;ne&#39;,&#39;cn&#39;,&#39;nc&#39;],searchhidden:true},hidden: true ,editrules: {edithidden:true,"class":"validate[required,custom[onlyLetterSp]] text-input"},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; editable:true,editoptions:{"class":"validate[required,custom[onlyLetterSp]] text-input"}<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; },</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;name&#39;, index:&#39;name&#39;, width:50, align:&#39;left&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; search : false,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160; editable:true,editoptions:{"class":"validate[required,custom[onlyLetterSp]] text-input"}<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160; },</p>
<p>&#160;&#160; &#160;&#160;&#160; {name:&#39;roles&#39;, index:&#39;roles&#39;, width:30, align:&#39;left&#39;,<br />&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; search : false,editable:true,edittype:&#39;custom&#39;,editoptions:{ custom_element:MultiCheckElem, custom_value:MultiCheckVal, list:&#39;User,Manager,PMO&#39;,recreateForm: true,"class":"validate[required]"<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }},</p>
<p>&#160;&#160; &#160;&#160;&#160; {name:&#39;location&#39;, index:&#39;location&#39;, width:20, align:&#39;left&#39;,<br />&#160;&#160; &#160;&#160; &#160;&#160;&#160; &#160;&#160; &#160;&#160;&#160; &#160;&#160; searchoptions:{sopt:[&#39;eq&#39;, &#39;ne&#39;,&#39;cn&#39;,&#39;nc&#39;]},resizable:true,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160; editable:true,edittype:&#39;select&#39;,editoptions:{ value:getlocation(),<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160; "class":"validate[required]"}<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160; },</p>
<p>&#160;&#160; &#160;&#160;&#160; {name:&#39;groupname&#39;, index:&#39;groupname&#39;, width:35, align:&#39;left&#39;,<br />&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; search : false,resizable:true,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160; editable:true,edittype:&#39;select&#39;,editoptions:{value:getgroups(),"class":"validate[required]"}<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160; },</p>
<p>&#160;&#160; &#160;&#160;&#160; {name:&#39;email&#39;, index:&#39;email&#39;, width: 35, align:&#39;left&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160; searchoptions:{sopt:[&#39;eq&#39;, &#39;ne&#39;,&#39;cn&#39;,&#39;nc&#39;]},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; editable:true,editoptions:{"class":"validate[required,custom[email]]"}<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; },<br />&#160;&#160;&#160;&#160;&#160;&#160; ],</p>
</p>
<p>jQuery.extend(jQuery.jgrid.edit, {<br />&#160;&#160;&#160; onclickSubmit : function(params,postdata) {</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<strong>&#160; jQuery(document).ready(function(){<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160; // binds form submission and fields to the validation engine<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; if(!jQuery("#FrmGrid_list").validationEngine(&#39;validate&#39;)){</strong></p>
<p>&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return false;</p>
<p>&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; &#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; }</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; });<br />&#160; },</p>
<p>&#160; afterComplete : function (response, postdata, formid) {</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (postdata.oper === "add") { // highlight on "add" only<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var row = jQuery ("#"+$.jgrid.jqID(postdata.id), jQuery(this.gbox));<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; row.effect("highlight", {color:"red"}, 3000);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160; },</p>
<p>&#160; afterclickPgButtons: function(whichbutton, formid, rowid) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var rolename = $(&#39;#list&#39;).getCell(rowid,4)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if(rolename ==="User") {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; document.getElementsByName("roles")[0].checked = true;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if(rolename ==="User/Manager") {<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; document.getElementsByName("roles")[0].checked = true;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; document.getElementsByName("roles")[1].checked = true;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if(rolename==="User/Manager/PMO") {<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; document.getElementsByName("roles")[0].checked = true;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; document.getElementsByName("roles")[1].checked = true;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; document.getElementsByName("roles")[2].checked = true;<br />&#160;&#160; &#160;&#160;&#160; &#160; }<br />&#160;},</p>
<p>&#160;onClose: function(params, posdata) {<br />&#160;&#160;&#160;&#160;&#160; $(".formError").detach();<br />&#160;&#160;&#160; },<br />&#160;&#160;&#160; clearAfterAdd :false,<br />&#160;&#160;&#160; closeAfterAdd: true,<br />&#160;&#160;&#160; closeAfterEdit:true,<br />&#160;&#160;&#160; recreateForm: true,</p>
<p>&#160;});</p>
</p>
<p>Thanks in advacce</p>
]]></description>
        	        	<pubDate>Thu, 03 Feb 2011 15:22:49 +0200</pubDate>
        </item>
</channel>
</rss>