Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7406373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:32:55+00:00 2026-05-29T05:32:55+00:00

I am modifying the content. Data is being shown inside <div> country, but how

  • 0

I am modifying the content. Data is being shown inside <div> country, but how to autofill a textbox present in auto.jsp? I’m getting data from get.jsp and content of get.jsp is being shown on auto.jsp in country <div>.

auto.jsp

<%@page import="java.sql.*"%>
<html>
    <head>  
        <script language="javascript" type="text/javascript">  
            var xmlHttp  
            var xmlHttp
            function showState(str){ 
                if (typeof XMLHttpRequest != "undefined"){
                    xmlHttp= new XMLHttpRequest();
                }
                else if (window.ActiveXObject){
                    xmlHttp= new ActiveXObject("Microsoft.XMLHTTP");
                }
                if (xmlHttp==null){
                    alert ("Browser does not support XMLHTTP Request")
                    return
                } 
                var url="get.jsp";//goes to get.jsp
                url += "?count=" +document.getElementById("textbox1").value;
                url += "&secondVal="+document.getElementById("textbox2").value;
                xmlHttp.onreadystatechange = stateChange;
                xmlHttp.open("GET", url, true);
                xmlHttp.send(null);
            }
            function stateChange(){   
                if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){   
                    document.getElementById("country").innerHTML=xmlHttp.responseText;  
                }   
            }   
        </script>  
    </head>  
    <body>  
        <input id="textbox1" type="text" name="name" onkeyup="showState(this.value)"/> 
        <input id="textbox2" type="text" name="secondVal" onkeyup="showState(this.value)"/>
        <br>  
        <div id='country'>
            Here Iam getting data from get.jsp
        </div>  
        <input type="text"/> //how to fill up this text box based on previous textbox 1 and textbox 2(written just above)?
    </body> 
</html>

get.jsp

<%
    String s=request.getParameter("count");//Got first textbox value
    out.println(s);
    String secondVal=request.getParameter("secondVal");// Got second textbox value
    out.println(secondVal);
    request.setAttribute("s", s);
%>

<input type="text" value="<%=s%>"/>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T05:32:55+00:00Added an answer on May 29, 2026 at 5:32 am

    See your function stateChange(), you are changing the value of country there. So you can change this to apply the result to other element too, for example:

    function stateChange(){   
      if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){   
        document.getElementById("country").innerHTML = xmlHttp.responseText;  
        document.getElementById("textbox2").value = xmlHttp.responseText;
      }   
    }  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm modifying a mature CGI application written in Perl and the question of content
My jqGrid that does a great job of pulling data from my database, but
I'm modifying the content of a href attribute with jQuery: $(a#scrolll).attr(href, # + $(li.matched).attr(id));
I have some flatpages with empty content field and their content inside the template
Modifying the HTTP Response Using Filters
Modifying a SnapPages theme, meaning I only have access to the CSS stylesheet. I
Duplicate Modifying A Collection While Iterating Through It Has anyone a nice pattern to
I am modifying an existing WinForms app which is setup with a custom TraceListener
I am modifying some code and came across a declaration that I am having
I am modifying a Nant build script to run some unit tests. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.