Disabling/enabling requiredFieldValidators with javascript and server side

后端 未结 5 1917
北海茫月
北海茫月 2020-12-30 12:12

I have a drop down (dropdown2) that is required IF there is something in it but it\'s options data is driven by ajax from another dropdown (dropdown1) selec

5条回答
  •  孤城傲影
    2020-12-30 12:25

    DISABLE

    document.getElementById("<%=ReqVal.ClientID%>").style.visibility = "hidden"; 
    
    document.getElementById("<%=ReqVal.ClientID%>").enabled = false;
    

    ENABLE

    document.getElementById("<%=ReqVal.ClientID%>").style.visibility = "visible"; 
    
    document.getElementById("<%=ReqVal.ClientID%>").enabled = true;
    

提交回复
热议问题