<body onload="document.formName.yhjb.value="document.formName.authority.options[document.formName.authority.selectedIndex].text">

解决方案 »

  1.   

    <body onload="document.formName.yhjb.value=document.formName.authority.options[document.formName.authority.selectedIndex].text">
    <form name=formName>
    <select name="authority" id="authority" onChange="yhjb.value=this.options[this.selectedIndex].text">
                          <option value="0">管理员</option>
                          <option value="1" selected>操作员</option>
    <input name="yhjb" type="hidden" id="yhjb" value=""> 
    </form>
      

  2.   

    <script language=javascript>
    function fun()
    {
    document.all.yhjb.value=document.all.authority.options[authority.selectedIndex].text
    }
    </script>
    <select name="authority" id="authority" onChange=fun()>