
Untitled
By: a guest on
May 1st, 2012 | syntax:
None | size: 1.35 KB | hits: 8 | expires: Never
autofill multiple textboxes based on single textbox value
$("#textbox1").keyup(function() {
$.get('state.jsp', {count : this.value}, function(responseData) {
$("#textbox2").val(responseData);//getting value in 2nd text box
$("#textbox3").val(responseData);// here also i am receiving same value as that 2nd textbox, how can i get a different value here?
});
});
<%
String firsttextbox=request.getParameter("count");
out.println(firsttextbox); //displayed in 2nd textbox plus it is also showing the below 3rdtextbox value, but i want to display out.println(firsttextbox); by 2nd textbox id only
String 3rdtextbox="3rd textbox value";
out.println(3rdtextbox); // it also displayed 3rdtextbox value plus it is also showing the 2nd textbox value
//How can i separate these two outputs so that `first println() will be displayed in 2nd textbox and 3rd println() will be displayed in 3rd text box?`
%>
<%
String firsttextbox=request.getParameter("count");
String 3rdtextbox="3rd textbox value";
out.println(firsttextbox+'|'+3rdtextbox);// + for concatenation ?
%>
$("#textbox1").keyup(function() {
$.get('state.jsp', {count : this.value}, function(responseData) {
result=responseData.split('|');
$("#textbox2").val(result[0]);
$("#textbox3").val(result[1]);
});
});