<?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 UI Dialog And The Enter &#8211; Return Key Problem</title>
	<atom:link href="http://codingrecipes.com/jquery-ui-dialog-and-the-enter-return-key-problem/feed" rel="self" type="application/rss+xml" />
	<link>http://codingrecipes.com/jquery-ui-dialog-and-the-enter-return-key-problem</link>
	<description></description>
	<lastBuildDate>Sun, 22 Jan 2012 07:31:56 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
	<item>
		<title>By: Stef</title>
		<link>http://codingrecipes.com/jquery-ui-dialog-and-the-enter-return-key-problem/comment-page-1#comment-4006</link>
		<dc:creator>Stef</dc:creator>
		<pubDate>Wed, 28 Dec 2011 11:27:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.code-head.com/?p=810#comment-4006</guid>
		<description>Thank you. Helped me a lot !</description>
		<content:encoded><![CDATA[<p>Thank you. Helped me a lot !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: piR</title>
		<link>http://codingrecipes.com/jquery-ui-dialog-and-the-enter-return-key-problem/comment-page-1#comment-3996</link>
		<dc:creator>piR</dc:creator>
		<pubDate>Wed, 14 Dec 2011 13:48:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.code-head.com/?p=810#comment-3996</guid>
		<description>Very complicated.

http://stackoverflow.com/questions/868889/submit-jquery-ui-dialog-on-enter

$(&#039;#DialogTag&#039;).keyup(function(e) {
    if (e.keyCode == 13) {
        //Close dialog and/or submit here...
    }
});

Assuming you wrote a function to bind it to the OK button, you just have to call it again.

(14 dec 2011)</description>
		<content:encoded><![CDATA[<p>Very complicated.</p>
<p><a href="http://stackoverflow.com/questions/868889/submit-jquery-ui-dialog-on-enter" rel="nofollow">http://stackoverflow.com/questions/868889/submit-jquery-ui-dialog-on-enter</a></p>
<p>$(&#8216;#DialogTag&#8217;).keyup(function(e) {<br />
    if (e.keyCode == 13) {<br />
        //Close dialog and/or submit here&#8230;<br />
    }<br />
});</p>
<p>Assuming you wrote a function to bind it to the OK button, you just have to call it again.</p>
<p>(14 dec 2011)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cory</title>
		<link>http://codingrecipes.com/jquery-ui-dialog-and-the-enter-return-key-problem/comment-page-1#comment-2043</link>
		<dc:creator>Cory</dc:creator>
		<pubDate>Sun, 05 Jun 2011 00:12:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.code-head.com/?p=810#comment-2043</guid>
		<description>@Robert - What version of jQuery UI are you using that has a className option for buttons?</description>
		<content:encoded><![CDATA[<p>@Robert &#8211; What version of jQuery UI are you using that has a className option for buttons?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ozil</title>
		<link>http://codingrecipes.com/jquery-ui-dialog-and-the-enter-return-key-problem/comment-page-1#comment-1825</link>
		<dc:creator>Ozil</dc:creator>
		<pubDate>Wed, 13 Apr 2011 19:27:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.code-head.com/?p=810#comment-1825</guid>
		<description>You are the man! Thanks for the help. I got my code to work like this:
&lt;pre lang=&quot;javascript&quot;&gt;
		$saveAsDialog.dialog(&#039;open&#039;).find(&#039;input&#039;).keypress(function(e)
		{
			if ((e.which &amp;&amp; e.which == 13) &#124;&#124; (e.keyCode &amp;&amp; e.keyCode == 13))
			{
				$(this).parent().parent().parent().parent().find(&#039;.ui-dialog-buttonpane&#039;).find(&#039;button:first&#039;).click();
				return false;
			}
		});
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>You are the man! Thanks for the help. I got my code to work like this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">		$saveAsDialog.<span style="color: #660066;">dialog</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'open'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">keypress</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">which</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> e.<span style="color: #660066;">which</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">13</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">keyCode</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> e.<span style="color: #660066;">keyCode</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">13</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.ui-dialog-buttonpane'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'button:first'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Robert</title>
		<link>http://codingrecipes.com/jquery-ui-dialog-and-the-enter-return-key-problem/comment-page-1#comment-1789</link>
		<dc:creator>Robert</dc:creator>
		<pubDate>Mon, 04 Apr 2011 14:44:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.code-head.com/?p=810#comment-1789</guid>
		<description>I found a quite simple solution for this problem:
&lt;pre lang=&quot;javascript&quot;&gt;
    var d = $(&#039;&#039;).dialog(
        buttons: [{
            text: &quot;Ok&quot;,
            click: function(){
                // do something
                alert(&#039;it works&#039;);
            },
            className: &#039;dialog_default_button&#039;
        }]
    });

    $(d).find(&#039;input&#039;).keypress(function(e){
        if ((e.which &amp;&amp; e.which == 13) &#124;&#124; (e.keyCode &amp;&amp; e.keyCode == 13)) {
            e.preventDefault();
            $(&#039;.dialog_default_button&#039;).click();
        }
    });
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>I found a quite simple solution for this problem:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">    <span style="color: #003366; font-weight: bold;">var</span> d <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">dialog</span><span style="color: #009900;">&#40;</span>
        buttons<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#123;</span>
            text<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Ok&quot;</span><span style="color: #339933;">,</span>
            click<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                <span style="color: #006600; font-style: italic;">// do something</span>
                <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'it works'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
            className<span style="color: #339933;">:</span> <span style="color: #3366CC;">'dialog_default_button'</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#93;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    $<span style="color: #009900;">&#40;</span>d<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">keypress</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">which</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> e.<span style="color: #660066;">which</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">13</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">keyCode</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> e.<span style="color: #660066;">keyCode</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">13</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            e.<span style="color: #660066;">preventDefault</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.dialog_default_button'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Merijn</title>
		<link>http://codingrecipes.com/jquery-ui-dialog-and-the-enter-return-key-problem/comment-page-1#comment-1650</link>
		<dc:creator>Merijn</dc:creator>
		<pubDate>Sat, 19 Feb 2011 11:31:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.code-head.com/?p=810#comment-1650</guid>
		<description>Works very well. Be carefull that it does not click ok button in other (hidden) dialogs as well.

I removed .parent().parent(), copied this for the other dialog and now they both work well.

Thanks.</description>
		<content:encoded><![CDATA[<p>Works very well. Be carefull that it does not click ok button in other (hidden) dialogs as well.</p>
<p>I removed .parent().parent(), copied this for the other dialog and now they both work well.</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Codehead</title>
		<link>http://codingrecipes.com/jquery-ui-dialog-and-the-enter-return-key-problem/comment-page-1#comment-1471</link>
		<dc:creator>Codehead</dc:creator>
		<pubDate>Mon, 06 Dec 2010 21:38:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.code-head.com/?p=810#comment-1471</guid>
		<description>Usted es muy agradable, me alegro de haber podido ayudar!</description>
		<content:encoded><![CDATA[<p>Usted es muy agradable, me alegro de haber podido ayudar!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Camilo</title>
		<link>http://codingrecipes.com/jquery-ui-dialog-and-the-enter-return-key-problem/comment-page-1#comment-1470</link>
		<dc:creator>Camilo</dc:creator>
		<pubDate>Mon, 06 Dec 2010 21:15:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.code-head.com/?p=810#comment-1470</guid>
		<description>la verdad no se ingles pero de verdad muchas gracias me salvaste por que no sabia que hacer y tu codigo funciona excelentemente</description>
		<content:encoded><![CDATA[<p>la verdad no se ingles pero de verdad muchas gracias me salvaste por que no sabia que hacer y tu codigo funciona excelentemente</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roll</title>
		<link>http://codingrecipes.com/jquery-ui-dialog-and-the-enter-return-key-problem/comment-page-1#comment-1385</link>
		<dc:creator>Roll</dc:creator>
		<pubDate>Wed, 06 Oct 2010 05:17:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.code-head.com/?p=810#comment-1385</guid>
		<description>You&#039;re the master! Thanks soooo much for that fix. Worked a charm.</description>
		<content:encoded><![CDATA[<p>You&#8217;re the master! Thanks soooo much for that fix. Worked a charm.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Codehead</title>
		<link>http://codingrecipes.com/jquery-ui-dialog-and-the-enter-return-key-problem/comment-page-1#comment-1383</link>
		<dc:creator>Codehead</dc:creator>
		<pubDate>Fri, 01 Oct 2010 17:53:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.code-head.com/?p=810#comment-1383</guid>
		<description>Wow, so they didn&#039;t fix this yet?</description>
		<content:encoded><![CDATA[<p>Wow, so they didn&#8217;t fix this yet?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

