I am receiving data from state.jsp by JSON and displaying data in auto.jsp in a textbox having id textbox2.But i am not able to edit that textbox where i am receiving data, why?
//auto.jsp:
$("#combo1").change(function() {
// by onchange event of combobox, i am displaying string "anyname"
// on that below textbox.
$.getJSON('state.jsp', { combo1Val : $(this).val() }, function(responsedata) {
$("#textbox2").replaceWith(responsedata.name);
});
});
// i am displaying "anyname" here, but why i am not able
// to edit this text box after displaying? I have not set it to readonly
<input type="text" id="textbox2" name="2ndtextbox/>
//state.jsp
<%@page import="net.sf.json.JSONObject"%>
<%@page import="net.sf.json.JSONArray"%>
<%
JSONObject arrayObj= new JSONObject();
arrayObj.put("name","anyname");// displaying "anyname" in that textbox
response.setContentType("application/json");
response.getWriter().write(arrayObj.toString());
%>
I am displaying string "anyname" in that text box but i am not able to edit this textbox anymore why? I have not set it to readonly. Any help