Skip to content
Browse files

Much cooler way to set the form focus after an error. Sent in by Greg…

… Barnett.
  • Loading branch information...
1 parent 778c286 commit 93f03cc436f89c8f17fc11958670a254f1d10a81 moodler committed Dec 14, 2002
Showing with 3 additions and 5 deletions.
  1. +3 −5 login/signup.php
View
8 login/signup.php
@@ -34,11 +34,9 @@
}
}
- if ($err) {
- foreach ((array)$err as $key => $value) {
- $focus = "form.$key";
- }
- }
+ if ($err) {
+ $focus = 'form.' . array_shift(array_flip(get_object_vars($err)));
+ }
if (!$user->country and $CFG->country) {
$user->country = $CFG->country;

0 comments on commit 93f03cc

Please sign in to comment.
Something went wrong with that request. Please try again.