<?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: beforeSubmit Event</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/beforesubmit-event</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/beforesubmit-event/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Nathan on beforeSubmit Event</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/beforesubmit-event#p7229</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/beforesubmit-event#p7229</guid>
        	        	<description><![CDATA[<p>Hey, nevermind, I resolved the issue.&#160; It occured to me that I can assign the response from the script to a variable in javascript within the beforeSubmit event and then process my request accordiningly.</p>
<p>Solutions always occur after you&#39;ve posted something.&#160;</p>
<p>N</p></p>
]]></description>
        	        	<pubDate>Sun, 14 Jun 2009 08:13:20 +0300</pubDate>
        </item>
        <item>
        	<title>Nathan on beforeSubmit Event</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/beforesubmit-event#p7226</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/beforesubmit-event#p7226</guid>
        	        	<description><![CDATA[<p>Not to sure if this is related but firebug keeps reporting the same issue:</p>
<div class="logRow logRow-spy loaded"></div>
<p><span class="objectBox objectBox-errorMessage hasTwisty hasBreakSwitch"></span></p>
<div class="errorTitle">ret is undefined</div>
<div class="errorSourceBox errorSource-exec">[Image Can Not Be Found]<span class="errorSource"> if(ret[0]) {</span></div>
<div class="errorSourceBox errorSource-exec"></div>
<div class="errorSourceBox errorSource-exec">grid.formedit.js line 279</div>
<div class="errorSourceBox errorSource-exec"></div>
<div class="errorSourceBox errorSource-exec">Using version 3.4.2 of the grid.</div>
<div class="errorSourceBox errorSource-exec"></div>
<div class="errorSourceBox errorSource-exec">Nathan</div></p>
]]></description>
        	        	<pubDate>Sat, 13 Jun 2009 22:07:01 +0300</pubDate>
        </item>
        <item>
        	<title>Nathan on beforeSubmit Event</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/beforesubmit-event#p7225</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/beforesubmit-event#p7225</guid>
        	        	<description><![CDATA[<p>Hi,</p>
<p>I&#39;m attempting to to check some data before the actual submit to the database occurs.&#160; Essentially I have date, start and finish time, and a lunch break.&#160; I need to check a few things including if the person has already said that they worked during that time.&#160; For that I need to jump to my database and a script called ValidateTimeEntry.php takes care of that.&#160; It returns a string in xhr of boolean:string (ie : "true:" or "false:Start is greater than Finish" )</p>
<p>The value is being returned correctly but I am expecting the event o push the error to the form, or submit the form if there is no error. Here&#39;s the code I am using for the beforeSubmit event:</p>
<p>beforeSubmit:function(pdata){</p>
<p>//&#160;&#160;&#160; &#160;&#160;&#160; &#160; return [false,"Some Message"];<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; var aurl = "/actions/ValidateTimeEntry.php";<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; jQuery.post(aurl,{DATE:pdata.DATE,START:pdata.START,FINISH:pdata.FINISH,LUNCH:pdata.LUNCH},function(xhr){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; var splits = xhr.split(":");<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; if(splits[0] == "TRUE"){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; //jQuery("#dialogPM").dialog(&#39;open&#39;);&#160;&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; return[true];<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }else{<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; //some error has occured - post the message to the dialog<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; //jQuery(grid).trigger("reloadGrid");<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; return[false,splits[1]];<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; });<br />&#160;&#160;&#160; &#160;&#160;&#160; }</p>
</p>
<p>i&#39;m not to sure why the event is not cancelled or the message posted, or why the data is not submitted.&#160; To me it seems like xhr is local to just the ajax post and does not push back to actual beforeSubmit event. Any suggestions on how to fix this ?</p>
<p>Nathan</p>
]]></description>
        	        	<pubDate>Sat, 13 Jun 2009 21:32:08 +0300</pubDate>
        </item>
</channel>
</rss>