私は編集を許可する2つのモードを持つフォームを持っています(テキストボックスの値)
and another mode for (non-manager) user - code behind adding "READONLY" to the TextBox tag.
so with the readonly 'mode' there's no input accepted in text box at all
my question is how could i execute validation method based on "READONLY" property of text box ?
strRo = "READONLY" on a condition
<asp:TextBox ID="txtNumbers" runat="server" <%=strRo %> onkeypress="return allowonlynumbers();" />
javascript function
function allowonlynumbers() {
if (event.keyCode >= 48 && event.keyCode <= 57) {
return true;
}
else {
alert('Only numbers can be entered');
return false;
}
}