
hello, Please tell me how to enable label and text box on selection of drop down list box. in drop down list box all values come from database. please reply.

Hi Friend,
Try this:
<%@page import="java.sql.*"%>
<html>
<script>
function ch(){
document.getElementById('lab').innerHTML="Name";
document.getElementById('txt').disabled=false;
}
</script>
<form name="form">
<table>
<tr><td>Select</td><td><select id="sel" onchange="ch();">
<%
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","root");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("Select * from data");
while(rs.next()){
%>
<option value="<%=rs.getInt("id")%>"><%=rs.getInt("id")%></option>
<%
}
%>
</select></td></tr>
<tr><td><label id="lab" disabled="true"></label></td><td><input type="text" id="txt" disabled="true"></td></tr>
</table>
</form>
Thanks
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.