function testing(){
var e = document.getElementById("selectBranchId");
var strUser = e.options[e.selectedIndex].value;
return strUser;
}
function test(){
var resultValue = testing();
alert(resultValue);
}
How can I get the value of resultValue
in JSP? I tried using request.setAttribute
but I am getting error variable resultValue
can't be resolved. What can be the solution?
As JavaScript runs on the client side and JSP/Scriptlet is running on the server-side.
So if you want to access any of your JavaScript variable in JSP/Java/Server Side, then either