Posted by JSCSJSCS on May 27, 2012 at 4:39pm
As the subject implies, I desire for usability purposes to set the focus to the first input of an exposed input field. I've searched and can only find mention of something like this:
<?php
drupal_add_js("$('#edit-name').focus();", 'inline');
?>But there no mention of where to put it or how to use it, or if '#edit-name' is the ID of the input text box or the name of it.
I've tried putting the above in a custom module, in the page.tpl and others.
Obviously, I have tried several iterations and locations, but cannot find the key to open this lock.
Any help appreciated!

Comments
It look like you may have to
It look like you may have to wrap your code in (function ($) {... })(jQuery); or jQuery() since you cannot rely on $().
Maybe something along the lines of:
<?phpdrupal_add_js('jQuery(document).ready(function () {
jQuery('input#edit-name').focus();
});', 'inline');
?>