AW: AW: AW: [Javascript] Re: <select> focussieren

Michael Borchers borchers at tridem.de
Tue Feb 8 07:29:36 CST 2005


> >good it helped you:)
> >
> >so here is the complete code that should work,
> >but it won't, neither with a form name and document.formname
> >or without document., am i missing something?
> >
> ><html>
> ><head>
> ><title></title>
> ></head>
> >
> ><body>
> >
> ><script language="JavaScript" type="text/javascript">
> >document.getElementById("art").focus();
> ></script>
> >
> ><form action="" method="get">
> >
> ><table width="100%">  
> >  <tr> 
> >    <td>
> >	  <select name="art" id="art">
> >	    <option value=""></option>
> >	    <option value="A">A</option>
> >	    <option value="D">D</option>
> >	    <option value="I">I</option>
> >	    <option value="L">L</option>
> >	    <option value="T" selected>T</option>
> >	    <option value="Text">Text</option>
> >	    <option value="F">F</option>
> >	  </select>
> >    </td>  
> >  </tr>
> ></table>
> ></form>
> >_______________________________________________
> >Javascript mailing list
> >Javascript at LaTech.edu
> >https://lists.LaTech.edu/mailman/listinfo/javascript
> >  
> >
> document.getElementById("art") doesn't exist at that moment 
> of parsing.. 
> put the script after the form and it would work a lot better..

this would look like this, i also tried it without the formname,
but still the select field isn't focused when loading the page:(

<html>
<head>
<title></title>
</head>

<body>

<form action="" method="get" name="reparatur">
<script language="JavaScript" type="text/javascript">
document.reparatur.getElementById("art").focus();
</script>
<table width="100%">  
  <tr> 
    <td>
	  <select name="art" id="art">
	    <option value=""></option>
	    <option value="A">A</option>
	    <option value="D">D</option>
	    <option value="I">I</option>
	    <option value="L">L</option>
	    <option value="T" selected>T</option>
	    <option value="Text">Text</option>
	    <option value="F">F</option>
	  </select>
    </td>  
  </tr>
</table>
</form>



More information about the Javascript mailing list