<tr>
        <td height="20" bgcolor="#FFFFFF" align="center" width="50%">
          调动类型
        </td>
         <td height="20" bgcolor="#FFFFFF" align="center" width="50%">
               <s:radio list="#{0:'调动',1:'离职'}" name="rtype" id="rtype"/>           </td>
      </tr>
         <tr>
        <td height="20" bgcolor="#FFFFFF" align="center" width="50%">
           新部门
        </td>
         <td height="20" bgcolor="#FFFFFF" align="center" width="50%">
              <SELECT name="departid" style="width:24.5%" id="departid">
                   <s:iterator value="data.departmentlist" var="st">
                    <option value="<s:property value="id"/>"><s:property value="name"/></option>
                   </s:iterator>
             </SELECT>  
     
         </td>
        </tr>
     当点击“调动”的时候、下面的新部门下拉框可用,当点击“离职”时。下拉列表改为只读模式、帮忙写个javascript函数。

解决方案 »

  1.   

    functin changeShow(){
         var sel = document.getElementById("departid");
         sel.style.disabled="disabled";
    }
      

  2.   

      在rodio改变事件里改变控件的disabled属性就行了。
      

  3.   

    document.getElementById("departid").disabled="disabled";需要css吗?
      

  4.   

    $('#departid').attr('disabled','true')
      

  5.   


    document.getElementById("departid").disabled="disabled";document.getElementById("departid").removeAttribute("disabled");