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 7785013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:11:15+00:00 2026-06-01T20:11:15+00:00

I’m trying to get values from the table based on the eqid using the

  • 0

I’m trying to get values from the table based on the eqid using the sendxmlRequest() method:

 <select name="eqNAME" onchange="sendxmlRequest('GET','getEquipDetails.jsp',this.value)
 <options> ..... <options>
 </select>

This I have added in ajax.js file

//Make the XMLHttpRequest Object
var http = createRequestObject();
function sendxmlRequest(method, url,eqid){
    url = url + "?eqid="+eqid;
     if(method == 'get' || method == 'GET'){
    http.open(method,url,true);
    http.onreadystatechange = handleResponse;
    http.send(null);
    }
}    

function createRequestObject(){
    var req; try {
    // Firefox, Opera, Safari
    req = new XMLHttpRequest();
    } catch (e) {
    // Internet Explorer
    try {
    //For IE 6
    req = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
    try {
    //For IE 5
    req = new ActiveXObject("Microsoft.XMLHTTP");
    }
         catch (e) {
     alert('Your browser is not IE 5 or higher, or Firefox or Safari or Opera');
     }
   }
}
return req;

}

The following is used to handle the response (in ajax.js):

function handleResponse(){
if(http.readyState == 4 && http.status == 200){
    var response = http.responseText;
}
}

Here is my ‘getEquipDetails.jsp’ file:

<% 
String planLoc= theResult1.getString(2) == null ? "":theResult1.getString(3);
String changLoc= theResult1.getString(3) == null ? "":theResult1.getString(4)
%> 
<%
response.setHeader("Pragma", "no-cache"); //HTTP 1.0
response.setDateHeader("Expires", 0); //prevents caching at the proxy server
response.setHeader("Cache-Control", "no-cache, private, no-store, max-stale=0"); //  HTTP 1.1
%>

My query is, how do we get the values planLoc and changLoc from the getEquipDetails.jsp and set it in responseText, so that it can be updated in the drop-down in my page?

Or is there any other way to go about it?

Note: I haven’t given the table retrieval code, since that is already taken care of. I just want the planLoc and changLoc updated in my JSP page

  • 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-06-01T20:11:16+00:00Added an answer on June 1, 2026 at 8:11 pm

    In getEquipDetails.jsp

    Write values response.getWriter() object.

    <%
    response.setHeader("Pragma", "no-cache"); //HTTP 1.0
    response.setDateHeader("Expires", 0); //prevents caching at the proxy server
    response.setHeader("Cache-Control", "no-cache, private, no-store, max-stale=0"); //  HTTP 1.1
    PrintWriter res = response.getWriter();
    res.println(planLoc);
    res.println(changLoc);
    res.close();
    %>
    

    Then In

    function handleResponse(){
      if(http.readyState == 4 && http.status == 200){
        document.getElementById("dataTable").innerHTML = http.responseText;  
        // dataTable will be id of any HTML tag where you want to display the updated value.
      }
    }
    

    For Example:

    <div id="dataTable"></div>
    

    So, Response from AJAX will be set here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I am trying to render a haml file in a javascript response like so:

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.