Skip to content

Instantly share code, notes, and snippets.

@djgraham
Created April 6, 2011 09:33
Show Gist options
  • Select an option

  • Save djgraham/905392 to your computer and use it in GitHub Desktop.

Select an option

Save djgraham/905392 to your computer and use it in GitHub Desktop.
$(document).ready(function(){
//$('form input[type="text"]:first').attr("tabindex", 1);
var first_field = ($('form input[type="text"]:first').attr('name'));
var form = ($('form:first').attr('id'));
//alert (form + "- " + first_field);
if (first_field == "task[due_date]") {
$('form textarea:first').focus();
}
else
{
$('form input[type="text"]:first').focus();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment