gdrnec is correct in that the jsp is evaulated before the javascript.
For what you want to do you have 2 options.
1./ You could write the JSP variables into the javascript
e.g.
var TT = '<%= myJavaVariable%>';
function set_flag(flag_value){
TT = flag_value;
}
2./ You display your message using only JavaScript
function set_flag(flag_value){
if (flag_value){
document.getElementById("t
}else{
document.getElementById("f
}
}
<div name="trueMessage" style=" visibility:hidden">True</d
<div name="falseMessage" style=" visibility:hidden">False</
Main Topics
Browse All Topics





by: gdrnecPosted on 2005-08-24 at 12:46:58ID: 14746377
Problem is that the variable TT is being changed on the browser side after the JSP is interpreted and rendered so the jsp can't actually do anything with it as far as I know. It is possible for an Applet to comunicate with javascript on the current page but that doesn't sound applicable here.
Can you describe the application in any more depth?