<?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"
	>
<channel>
	<title>Comments on: Focus first text field using jQuery</title>
	<atom:link href="http://jacky.seezone.net/2008/04/14/1979/feed/" rel="self" type="application/rss+xml" />
	<link>http://jacky.seezone.net/2008/04/14/1979/</link>
	<description></description>
	<pubDate>Sun, 07 Sep 2008 01:06:12 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
		<item>
		<title>By: Jacky</title>
		<link>http://jacky.seezone.net/2008/04/14/1979/#comment-5819</link>
		<dc:creator>Jacky</dc:creator>
		<pubDate>Mon, 14 Apr 2008 04:21:47 +0000</pubDate>
		<guid isPermaLink="false">http://jacky.seezone.net/?p=1979#comment-5819</guid>
		<description>BTW, eq() also uses slice()</description>
		<content:encoded><![CDATA[<p><span class="caps">BTW</span>, eq() also uses slice()</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jacky</title>
		<link>http://jacky.seezone.net/2008/04/14/1979/#comment-5818</link>
		<dc:creator>Jacky</dc:creator>
		<pubDate>Mon, 14 Apr 2008 03:39:56 +0000</pubDate>
		<guid isPermaLink="false">http://jacky.seezone.net/?p=1979#comment-5818</guid>
		<description>anonymous: yes, can use eq() also.

小影: that's my interest... multiple forms, which may be 'hidden'</description>
		<content:encoded><![CDATA[<p>anonymous: yes, can use eq() also.</p>
<p>小影: that&#8217;s my interest&#8230; multiple forms, which may be &#8216;hidden&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 小影</title>
		<link>http://jacky.seezone.net/2008/04/14/1979/#comment-5817</link>
		<dc:creator>小影</dc:creator>
		<pubDate>Mon, 14 Apr 2008 02:42:19 +0000</pubDate>
		<guid isPermaLink="false">http://jacky.seezone.net/?p=1979#comment-5817</guid>
		<description>&lt;pre&gt;&lt;code&gt;
  findFirstElement: function(form) {
    var elements = $(form).getElements().findAll(function(element) {
      return 'hidden' != element.type &#038;&#038; !element.disabled;
    });
    var firstByIndex = elements.findAll(function(element) {
      return element.hasAttribute('tabIndex') &#038;&#038; element.tabIndex &#62;= 0;
    }).sortBy(function(element) { return element.tabIndex }).first();
    return firstByIndex ? firstByIndex : elements.find(function(element) {
      return ['input', 'select', 'textarea'].include(element.tagName.toLowerCase());
    });
  },
  focusFirstElement: function(form) {
    form = $(form);
    form.findFirstElement().activate();
    return form;
  }
&lt;/code&gt;&lt;/pre&gt;

form 或 form 上層的 elements 是 hidden ... 是不行的</description>
		<content:encoded><![CDATA[<pre><code>
  findFirstElement: function(form) {
    var elements = $(form).getElements().findAll(function(element) {
      return &#39;hidden&#39; != element.type &#38;&#38; !element.disabled;
    });
    var firstByIndex = elements.findAll(function(element) {
      return element.hasAttribute(&#39;tabIndex&#39;) &#38;&#38; element.tabIndex &#38;gt;= 0;
    }).sortBy(function(element) { return element.tabIndex }).first();
    return firstByIndex ? firstByIndex : elements.find(function(element) {
      return [&#39;input&#39;, &#39;select&#39;, &#39;textarea&#39;].include(element.tagName.toLowerCase());
    });
  },
  focusFirstElement: function(form) {
    form = $(form);
    form.findFirstElement().activate();
    return form;
  }
</code></pre>
<p>form 或 form 上層的 elements 是 hidden &#8230; 是不行的</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anonymous</title>
		<link>http://jacky.seezone.net/2008/04/14/1979/#comment-5816</link>
		<dc:creator>anonymous</dc:creator>
		<pubDate>Mon, 14 Apr 2008 02:34:53 +0000</pubDate>
		<guid isPermaLink="false">http://jacky.seezone.net/?p=1979#comment-5816</guid>
		<description>Why slice() instead of eq()?

http://docs.jquery.com/Core/eq#position</description>
		<content:encoded><![CDATA[<p>Why slice() instead of eq()?</p>
<p><a href="http://docs.jquery.com/Core/eq#position" rel="nofollow">http://docs.jquery.com/Core/eq#position</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jacky</title>
		<link>http://jacky.seezone.net/2008/04/14/1979/#comment-5815</link>
		<dc:creator>Jacky</dc:creator>
		<pubDate>Mon, 14 Apr 2008 01:46:05 +0000</pubDate>
		<guid isPermaLink="false">http://jacky.seezone.net/?p=1979#comment-5815</guid>
		<description>Can this function handle when 
1) style="display:none" on the input? 
2) the form itself is under a div with display:none?</description>
		<content:encoded><![CDATA[<p>Can this function handle when <br />
1) style=&#8220;display:none&#8221; on the input? <br />
2) the form itself is under a div with display:none?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 小影</title>
		<link>http://jacky.seezone.net/2008/04/14/1979/#comment-5814</link>
		<dc:creator>小影</dc:creator>
		<pubDate>Mon, 14 Apr 2008 01:24:59 +0000</pubDate>
		<guid isPermaLink="false">http://jacky.seezone.net/?p=1979#comment-5814</guid>
		<description>呃... 上面  [ 0 ]  變了 [0]</description>
		<content:encoded><![CDATA[<p>呃&#8230; 上面  [ 0 ]  變了 [0]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 小影</title>
		<link>http://jacky.seezone.net/2008/04/14/1979/#comment-5813</link>
		<dc:creator>小影</dc:creator>
		<pubDate>Mon, 14 Apr 2008 01:23:23 +0000</pubDate>
		<guid isPermaLink="false">http://jacky.seezone.net/?p=1979#comment-5813</guid>
		<description>用 prototype 的話我會這樣：

&lt;pre&gt;&lt;code&gt;
 Event.observe(window, 'load', function() {
	try{
		($$('form')[0]).focusFirstElement();	
	} catch (e) {}	
 });
&lt;/code&gt;&lt;/pre&gt;

( 在page load 完後才 focus )</description>
		<content:encoded><![CDATA[<p>用 prototype 的話我會這樣：</p>
<pre><code>
 Event.observe(window, &#39;load&#39;, function() {
	try{
		($$(&#39;form&#39;)[0]).focusFirstElement();
	} catch (e) {}
 });
</code></pre>
<p>( 在page load 完後才 focus )</p>
]]></content:encoded>
	</item>
</channel>
</rss>
