[FormsFieldFocus]



Setzt den Focus auf ein bestimmtes Formularfeld.

[Kompatibilität]

[zwischen <HEAD> und </HEAD>]

<script language="JavaScript">

<!-- John Munn  (jrmunn@home.com) -->

<!-- Begin
 function putFocus(formInst, elementInst) {

if (document.forms.length > 0) {
   document.forms[formInst].elements[elementInst].focus();

}
 }
// The second number in the "onLoad" command in the body
// tag determines the form's focus. Counting starts with '0'
//  End -->
</script>

[in den <BODY> Tag]

onLoad="putFocus(0,1);">

[zwischen <BODY> und </BODY>]

<div align="center">
<form method="post" name="bogus" id="bogus-form">
<input type="text" name="bogus_field0" id="bogus_field0" size="20" maxlength="12"><br>
<input type="text" name="bogus_field1" id="bogus_field0" size="20" maxlength="12" value="Form focus is here!"><br>
<input type="text" name="bogus_field2" id="bogus_field0" size="20" maxlength="12">
</div>

[Autor]

John Munn

[Download]

Kopieren Sie bitte den Code

Copyright © 1998- Nightfire Webworker Archiv Script No: 0139