Andreas: onload=setfocus() außerhalb dem <body> aufrufen?

Beitrag lesen

Hi,

bis auf das es "document.sample.Titel" nicht gibt (JS-Fehler!!), sollte es so klappen:

<html>
  <head>
<script>
<!--
function setfocus() {
document.sample.Titel.focus();
}
// -->
</script>
</head>

<body>

<script language="javascript">
self.onload=setfocus();
</script>

<form name="sample" method="post" action="neu.php?id=<?=$id?>">
  <input type="text" name="Titel" value="<?=$titel?>" size="30" maxlength="200">
</form>

</body>
</html>

Ciao
Andreas