andi: Objekt erwartet (Function in js-file)

Beitrag lesen

o.k. Dann mal ein kleines Beispiel
<<< Die Html Seite (nur zum testen mit includierter Funktion) >>>>>
<<<<<<So funktioniert es
<html><head><title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
function test() {
document.form.feld.disabled=true;
}
</script> </head>

<body bgcolor="#FFFFCC" >
<form name="form" action="">
  <p>  <input type="button" name="Button" value="Abschicken" >  </p>
  <p>  <input type="text" name="feld"> </p>
  <p>  <input type="radio" name="kreis" value="eins"  onClick="test()">   </p>
</form> </body> </html>

<<<<<<<<<< HTML mit externer Funktion >>>>>>> läuft nicht!
<html> <head> <title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script language="JavaScript" type="text/javascript"  src="../scripting/versu.js"></script>
</head> <body bgcolor="#FFFFCC" > <form name="form" action="">
  <p> <input type="button" name="Button" value="Abschicken" > </p>
  <p> <input type="text" name="feld"> </p>
  <p> <input type="radio" name="kreis" value="eins"  onClick="test()">  </p>
</form>
</body>
</html>

<<<<<< js. File >>>>>
function test() {
document.form.feld.disabled=true;
}