Hi. I'm new to Ajax. I'd like to populate a hidden field on a form with a responseText from the server. I'm able to display the responseText in the HTML as an innerHTML. I'm just unsure how to populate the hidden field on the form. Any suggestions will be greatly appreciated!
:)
Here's the JS:
function getLocation(locationrouting)
{
var getLocation= newXMLHttpRequest(); // sending request
getLocation.open("GET", "/PP?PAGE=GETLOCATIONNAME&ROUTINGNUM=" + locationrouting, false);
getLocation.send(null); // getting location
var dv = document.getElementById("location_div");
var verifyUnfound()
if (getlocation.responseText === 'LOCATION NOT FOUND')
{
dv.style.color = "red";
}
else
{
dv.style.color = "black";
}
dv.innerHTML = getLocation.responseText;
}