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

This commit is contained in:
moodler 2002-12-14 08:24:34 +00:00
parent 778c28671a
commit 93f03cc436

View File

@ -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;