MDL-8062 chat, login page and messaging - removed name attribute from some <form>s and fixed focus; changed set_focus() JS to accept element ID == the $focus parameter in print_header() + other minor Strict XHTML fixes

This commit is contained in:
skodak
2007-01-03 20:35:09 +00:00
parent e6bfd8e45e
commit c7225fe291
5 changed files with 33 additions and 33 deletions
+6 -4
View File
@@ -73,12 +73,14 @@ function inserttext(text) {
}
<?php if (!empty($focus)) {
if(($pos = strpos($focus, '.')) !== false) {
//old style focus using form name - no allowed inXHTML Strict
$topelement = substr($focus, 0, $pos);
echo "function setfocus() { if(document.$topelement) document.$focus.focus(); }\n";
} else {
//focus element with given id
echo "function setfocus() { if(el = document.getElementById('$focus')) el.focus(); }\n";
}
else {
$topelement = $focus;
}
echo "function setfocus() { if(document.$topelement) document.$focus.focus(); }\n"; } ?>
} ?>
//]]>
</script>