<html>
<head></head>
<body>
<script language = 'javascript'>

document.write('<hr />');
document.write('<h3>示例 4.10 Select box</h3>');
document.write('<hr />');
document.write('<form name = "SELECTFORM">');
document.write('<select name = "Machine" onChange = "this.Form.Result.value = this.options[this.selectedIndex].value; this.selectedIndex = 0;">');
document.write('<option value = "" SELECTED />(一览)');
document.write('<option value = "DOS/V" SELECTED />DOS/V');
document.write('<option value = "Mac" SELECTED />Mac');
document.write('<option value = "UNIX" SELECTED />UNIX');
document.write('</select>');
document.write('<input type = "text" name = "Result" size = "20"><br />');
document.write('</form>');
document.write('<hr />');
</script>
</body>
</html>
网页错误详细信息用户代理: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E; InfoPath.2)
时间戳: Sat, 2 Apr 2011 01:54:47 UTC
消息: 'this.Form.Result' 为空或不是对象
行: 23
字符: 1
代码: 0
URI: file:///H:/wwwroot/www/Html/html49_select_box/html49.html我实在是检查不出来啊  综合以前的经验  1,大小写问题没有  没有看出来
2,拼写没有错误  
3,就差语法啦----->  大牛  帮帮吧    
 

解决方案 »

  1.   

    this.Form ->document.forms[0] .
    语法问题 建议用火狐看下 。
      

  2.   

    改为
    document.write('<select name = "Machine" onChange = "document.SELECTFORM.Result.value = this.options[this.selectedIndex].value; this.selectedIndex = 0;">');
      

  3.   


    我大胆的尝试了一下,把this.Form改成this.form就好了这是为什么呢???   
      

  4.   

     document.write('<select name = "Machine" onChange = "this.Form.Result.value = this.options[this.selectedIndex].value; this.selectedIndex = 0;">');
    改为
     document.write('<select name = "Machine" onChange = "document.forms[0].Result.value = this.options[this.selectedIndex].value;"; this.selectedIndex = 0;">');
      

  5.   

    不是吧,我试了下,在IE8,Firefox4和Chrome上都是工作的啊