Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 1st, 2012  |  syntax: None  |  size: 1.35 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. autofill multiple textboxes based on single textbox value
  2. $("#textbox1").keyup(function() {
  3.   $.get('state.jsp', {count : this.value}, function(responseData) {
  4.      $("#textbox2").val(responseData);//getting value in 2nd text box
  5.      $("#textbox3").val(responseData);// here also i am receiving same value as that 2nd textbox, how can i get a different value here?
  6.   });
  7. });
  8.        
  9. <%
  10.      String firsttextbox=request.getParameter("count");
  11.       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
  12.       String 3rdtextbox="3rd textbox value";
  13.       out.println(3rdtextbox); // it also displayed 3rdtextbox value plus it is also showing the  2nd textbox value
  14.       //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?`
  15. %>
  16.        
  17. <%
  18.      String firsttextbox=request.getParameter("count");
  19.      String 3rdtextbox="3rd textbox value";
  20.      out.println(firsttextbox+'|'+3rdtextbox);// + for concatenation ?
  21. %>
  22.        
  23. $("#textbox1").keyup(function() {
  24.       $.get('state.jsp', {count : this.value}, function(responseData) {
  25.         result=responseData.split('|');
  26.             $("#textbox2").val(result[0]);
  27.             $("#textbox3").val(result[1]);
  28.       });
  29. });