ENHANCEMENT When MemberLoginForm controller page has loaded, focus on the Email input field so the user doesn't have to focus the field themselves. Ticket #3418

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@70846 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2009-01-28 00:40:57 +00:00 committed by Sam Minnee
parent 65e3917fef
commit e80355eac1

View File

@ -36,6 +36,17 @@ class MemberLoginForm extends LoginForm {
if(Director::fileExists($customCSS)) {
Requirements::css($customCSS);
}
Requirements::javascript(THIRDPARTY_DIR . '/javascript/jquery/jquery.js');
// Focus on the email input when the page is loaded
Requirements::customScript("
(function($){
$(document).ready(function() {
$('#Email input').focus();
});
})(jQuery);
");
if(isset($_REQUEST['BackURL'])) {
$backURL = $_REQUEST['BackURL'];
@ -231,5 +242,4 @@ class MemberLoginForm extends LoginForm {
}
}
?>
?>