I have a form which has a text box and a drop down box. The value selected in the drop down is obtained from another java program which changes from time to time. User can change the value of the drop down for editing purposes. Now what I want is to make the text box enabled/disabled, depending upon the value that coming as selected in the drop down. The code is here.
<input type="text" size="3" name="length<%=f.getId()%>" value="<%=f.getLength()%>" disabled="disabled"/>
<div class="type">
<select name="type<%=f.getId()%>" id="field_type">
<%
for(Field.FieldType t : Field.FieldType.values()){
%>
<option value="<%=t.name()%>" <%=(t.equals(f.getFieldType())) ? "SELECTED" : "" %>> <%=t.name() %></option>
<% } %>
</select></div>