<?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 and text value of a select box</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/beforesubmit-and-text-value-of-a-select-box</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-and-text-value-of-a-select-box/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Nathan on beforesubmit and text value of a select box</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/beforesubmit-and-text-value-of-a-select-box#p5849</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/beforesubmit-and-text-value-of-a-select-box#p5849</guid>
        	        	<description><![CDATA[<p>Nevermind - fixed my own problem this time around 🙂</p>
<p>Turns out I never set reloadAfterSubmit:true to true ...</p>
<p>However, I still can&#39;t figure out if it&#39;s possible to post my response in the form.&#160; Any suggestions on how to access that field to change it ?</p>
<p>Nathan</p>
]]></description>
        	        	<pubDate>Fri, 03 Apr 2009 19:38:29 +0300</pubDate>
        </item>
        <item>
        	<title>Nathan on beforesubmit and text value of a select box</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/beforesubmit-and-text-value-of-a-select-box#p5848</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/beforesubmit-and-text-value-of-a-select-box#p5848</guid>
        	        	<description><![CDATA[<p>Hi Tony,</p>
</p>
<p>The afterSubmit works but I am little unclear on how to handle the cancellation part.&#160; I&#39;ve got</p>
<p>&#160;&#160;&#160; &#160;&#160;&#160; if (xhr.responseText=="Time Error!"){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; alert("Please correct your time entries");<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; //jQuery(&#39;#hours&#39;).trigger("reloadGrid");<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; return false;<br />&#160;&#160;&#160; &#160;&#160;&#160; }else{<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; return true;<br />&#160;&#160;&#160; &#160;&#160;&#160; }</p>
<p>My php file returns "Time Error!" correctly and does not actually add the information to the database - but the data is added to the grid.&#160; If I click refresh it&#39;s gone from the grid.&#160; How do I not have the grid not reflect the data until it&#39;s corrected.</p>
<p>Also, right now I&#39;m just using an alert box.&#160; Is there a means of using the error portion of the form ie. where it says "field required".&#160; How would I change that to indicate "Please correct the times"</p>
<p>Thanks for all your help!</p>
</p>
<p>Nathan</p>
]]></description>
        	        	<pubDate>Fri, 03 Apr 2009 19:30:57 +0300</pubDate>
        </item>
        <item>
        	<title>tony on beforesubmit and text value of a select box</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/beforesubmit-and-text-value-of-a-select-box#p5777</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/beforesubmit-and-text-value-of-a-select-box#p5777</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Why not use afterSubmit event - it is designed right for this purpose (If I understand right)</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Thu, 02 Apr 2009 10:48:32 +0300</pubDate>
        </item>
        <item>
        	<title>Nathan on beforesubmit and text value of a select box</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/beforesubmit-and-text-value-of-a-select-box#p5753</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/beforesubmit-and-text-value-of-a-select-box#p5753</guid>
        	        	<description><![CDATA[<p>Hi Tony,</p>
<p>I am not to clear on this method.&#160; I&#39;ve reviewed the documentation but I am still struggling.</p>
<p>What I want to do is grab the two values, Start, Finish which are select boxes.&#160; I want to compare them to ensure that finish is greater than start.&#160; If its not I want to push a message back to the edit form saying "Please correct time entries" and not post the data to the server. Essentially cancel the submit event if the times are incorrect.&#160; I can&#39;t seem to get the values and I am a little unclear on the documentation example(eparams).&#160; How is this variable set up for referencing array elements.&#160; Reviewing eparams in firebug did not indcate any values for any of the form controls.&#160; Just a little confused here.</p>
<p>onclickSubmit:function(pdata){<br />&#160;&#160;&#160; &#160;&#160;&#160; var retarray = {};</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; var d1 = pdata["START"];<br />&#160;&#160;&#160; &#160;&#160;&#160; var d2 = pdata["FINISH"];<br />&#160;&#160;&#160; &#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; alert("t_0 - " + d1);<br />&#160;&#160;&#160; &#160;&#160;&#160; alert("t_1 - " + d2);<br />&#160;&#160;&#160; &#160;&#160;&#160; return retarray;<br />&#160;&#160;&#160; &#160;&#160;&#160; <br />&#160;&#160;&#160; }</p>
<p>_______</p>
<p>My alternate solution would be to do this in the php file. I can compare the times passed in the param array and if there is an error push a message back to the form and not call the database update.&#160; But how do I push an error message back from the php file to the form?</p>
<p>Nathan</p>
]]></description>
        	        	<pubDate>Wed, 01 Apr 2009 21:47:15 +0300</pubDate>
        </item>
        <item>
        	<title>tony on beforesubmit and text value of a select box</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/beforesubmit-and-text-value-of-a-select-box#p5733</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/beforesubmit-and-text-value-of-a-select-box#p5733</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Yes this is true. The post array contain the key, but not the text.</p>
<p>If you want to post the text use onclickSubmit event (see docs) with your code above. This event should return array. It is a good idea to give other names of the posted data.</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Wed, 01 Apr 2009 03:57:13 +0300</pubDate>
        </item>
        <item>
        	<title>Nathan on beforesubmit and text value of a select box</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/beforesubmit-and-text-value-of-a-select-box#p5709</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/beforesubmit-and-text-value-of-a-select-box#p5709</guid>
        	        	<description><![CDATA[</p>
<p>Hi,</p>
<p>I&#39;m building a quick time validation (ie the end time for a task must be great than the start time)</p>
<p>I can create an event for the time boxes losing focus to alert via an alert message but I would prefer the message to come up when the submit button is clicked.</p>
<p>I&#39;ve tried using the beforesubmit event and I can get the id&#39;s of the select boxes but never the text associated with the value. I&#39;m trying as follows:</p>
<p>beforeSubmit:function(pdata){<br />&#160;&#160;&#160; &#160;&#160;&#160; //Note: pdata is changed to form_id to try the two lines below<br />&#160;&#160;&#160; &#160;&#160;&#160; //d1 = $("select#START :selected",form_id).text();<br />&#160;&#160;&#160; &#160;&#160;&#160; //d2 = $("select#FINISH :selected",form_id).text();<br />&#160;&#160;&#160; &#160;&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; var d1 = pdata["START"];<br />&#160;&#160;&#160; &#160;&#160;&#160; var d2 = pdata["FINISH"];<br />&#160;&#160;&#160; &#160;&#160;&#160; alert("t_0 - " + d1);<br />&#160;&#160;&#160; &#160;&#160;&#160; alert("t_1 - " + d2);<br />&#160;&#160;&#160; &#160;&#160;&#160; <br />&#160;&#160;&#160; }</p>
<p>Is there a means of grabbing the text value ?&#160; The commented lines are how I got the text values in the lost focus but it seems like pdata is just an array of the id&#39;s of select boxes?</p>
</p>
<p>Nathan</p>
]]></description>
        	        	<pubDate>Tue, 31 Mar 2009 21:13:44 +0300</pubDate>
        </item>
</channel>
</rss>