ok, so for just a general focusing issue now, I added
Event.observe(window, ''load'', function() {
var e =
$A(document.getElementsByTagName(''*'')).find(function(e) {
return (e.tagName.toUpperCase() == ''INPUT'' &&
(e.type == ''text'' ||
e.type == ''password''))
|| e.tagName.toUpperCase() == ''TEXTAREA'';
});
if (e) e.focus();
});
to my application.js, and when I view source I get
<form action="/issues/create" method="post">
<p>Issue:<br />
<input id="issue_description" name="issue[description]"
size="30"
type="text" />
<script type="text/javascript">
//<![CDATA[
$(''issue_description'').focus()
//]]>
</script></p>
<p><input name="commit" type="submit"
value="save" /> or <a
href="/issues">cancel</a></p>
</form>
but it still doesn''t work. I have to click on the text_field before I
type. I tired both firefox and I.E. and it doesn''t work on either. When
I use focus_fu,
the view source adds
<input id="issue_description" name="issue[description]"
size="30"
type="text" focus="true" />
ideas?
~Jeremy
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---