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:
+6
-4
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user