2012-08-11 95 views

回答

2

实现这一目标需要nothing to change服务器控制except the syntax就这个例子而言。

<asp:TextBox id="txt1" runat="server" value="Selected?"><asp:TextBox> 

<asp:Button id="btnSubmit" runat="server" OnClientClick="alert(isTextSelected();" ></asp:Button> 

    function isTextSelected() { 
input = document.getElementById('<%= test.ClientID %>')) 
     if (typeof input.selectionStart == "number") { 
      return input.selectionStart == 0 && input.selectionEnd == input.value.length; 
     } else if (typeof document.selection != "undefined") { 
      input.focus(); 
      return document.selection.createRange().text == input.value; 
     } 
    } 

0

你可以简单地通过使用

$('select, input').click(function(){ 
    $(this).removeClass('disabled'); 
}); 
相关问题