zenithwolf
09-11-2007, 11:07 PM
// send query to jsp for processing (with name of selected ingredient)
url = "get.jsp?selected_sub="
url += document.getElementById("sub_selectbox" +
qty_index).getElementsByTagName("option")[sub_index].text;
xmlHttp.open("GET", url, true);
xmlHttp.onreadystatechange = handleResponse;
xmlHttp.send(null);
// handle processed output
function handleResponse(){
if(xmlHttp.readyState == 4 && xmlHttp.status == 200) {
// store processed response text
var getVal = xmlHttp.responseText;
if (((a.getElementsByTagName("input")[0].value)*1)>1) {
getVal *= a.getElementsByTagName("input")[0].value;
}
// display the value to user with multiplier to account for servings change(s)
if (multiplier!=0) {
document.getElementById("qty" + qty_index).innerHTML=(getVal*multiplier);
}
else {
document.getElementById("qty" + qty_index).innerHTML=(getVal);
}
}
I am trying to get values from a JSP and display to USER, JSP gets values from a database. First displays 3 choices to user, user selects one and the JSP Gives back a table and there are few select boxes in the data returned and the user selects whatever option he wants in this table. This all works when I have two choices in the FIRST select box I talked about even in FF. But when I added a 3rd option (and the data associated with it returns) the user tires to select an option, Firebug tells me the handleResponse is not defined. This code is for the the select boxes from my JSP. Again all of this works in IE. Ill post screens cuz I don't have any way to put it online.
Initial selection:
http://www.geocities.com/alvurnuscopernarus/initial.JPG
then the data with select boxes comes in and displayed:
http://www.geocities.com/alvurnuscopernarus/showeddata.JPG
then i select the other option in the select box (first one in the table) and error happens >< :
http://www.geocities.com/alvurnuscopernarus/error.JPG
url = "get.jsp?selected_sub="
url += document.getElementById("sub_selectbox" +
qty_index).getElementsByTagName("option")[sub_index].text;
xmlHttp.open("GET", url, true);
xmlHttp.onreadystatechange = handleResponse;
xmlHttp.send(null);
// handle processed output
function handleResponse(){
if(xmlHttp.readyState == 4 && xmlHttp.status == 200) {
// store processed response text
var getVal = xmlHttp.responseText;
if (((a.getElementsByTagName("input")[0].value)*1)>1) {
getVal *= a.getElementsByTagName("input")[0].value;
}
// display the value to user with multiplier to account for servings change(s)
if (multiplier!=0) {
document.getElementById("qty" + qty_index).innerHTML=(getVal*multiplier);
}
else {
document.getElementById("qty" + qty_index).innerHTML=(getVal);
}
}
I am trying to get values from a JSP and display to USER, JSP gets values from a database. First displays 3 choices to user, user selects one and the JSP Gives back a table and there are few select boxes in the data returned and the user selects whatever option he wants in this table. This all works when I have two choices in the FIRST select box I talked about even in FF. But when I added a 3rd option (and the data associated with it returns) the user tires to select an option, Firebug tells me the handleResponse is not defined. This code is for the the select boxes from my JSP. Again all of this works in IE. Ill post screens cuz I don't have any way to put it online.
Initial selection:
http://www.geocities.com/alvurnuscopernarus/initial.JPG
then the data with select boxes comes in and displayed:
http://www.geocities.com/alvurnuscopernarus/showeddata.JPG
then i select the other option in the select box (first one in the table) and error happens >< :
http://www.geocities.com/alvurnuscopernarus/error.JPG