Browse Source

! Focus on the search box when on the search for members page.

Signed-off-by: Peter Spicer <[email protected]>
Peter Spicer 11 years ago
parent
commit
02c91a0084
1 changed files with 4 additions and 0 deletions
  1. 4 0
      Sources/Memberlist.php

+ 4 - 0
Sources/Memberlist.php

@@ -573,6 +573,10 @@ function MLSearch()
 
 		$context['sub_template'] = 'search';
 		$context['old_search'] = isset($_GET['search']) ? $_GET['search'] : (isset($_POST['search']) ? $smcFunc['htmlspecialchars']($_POST['search']) : '');
+
+		// Since we're nice we also want to default focus on to the search field.
+		addInlineJavascript('
+	$(\'input[name="search"]\').focus();', true);
 	}
 
 	$context['linktree'][] = array(