Reputation: 455
i got this code :
<%
for (int i = 0; i < nr_atte_old; i++) {
%>
<TD class="tb" align=center>
<INPUT class="txt_opz" type="text" style="width:40;" id="hDett_Sin4<%= i %>" name="hDett_Sin4<%= i %>" maxlength='2' value="<%=DataResultForm.getValueHTMLEncode( "hDett_old_risp_"+i )%>">
</TD>
<%
}
%>
the value is returnet from a stored procedure, how can i disable dinamically this input type if, for example his value is "hello"
HTML+CSS way is preferred, if possible (not using javascript)
Upvotes: 1
Views: 66
Reputation: 14992
Just use java condition:
<% String val = DataResultForm.getValueHTMLEncode( "hDett_old_risp_"+i );%>
<input value="<%=val%>" <%= val=='hello'?'disabled':'' %> />
Upvotes: 2