G
Gaurav
MY CODE IS
<% if (Status.equals("true") ) {
int Answer=9;
%>
<script language = "JAVASCRIPT">
window.alert("Your record has been added ");
var choice = window.confirm("Do you want to add the Instance of
this particular Resource ? ");
if (choice == true) {
window.alert("You are going to add a new Instance");
<% Answer=1; %>
window.alert("answer = " + <%= Answer %>);
} else {
window.alert("Thanx for NOT entering the record");
<% Answer=89; %>
}
window.alert("answer = " + <%= Answer %>);
</script>
%>
NOW THE PROBLEM IS
I am always gettin the "Answer" as 89, Irrespective what I choose in
the confirm button.
if i choose "True" to my confirm button, First my "Answer" is printed
as 1 , then it also executes the JSP tag in the "else" clause and makes
my "Answer" as 89.
Kindly help, what is the error ? Is it because I am embeeding JSP in
Jscript ?
regards
gaurav
<% if (Status.equals("true") ) {
int Answer=9;
%>
<script language = "JAVASCRIPT">
window.alert("Your record has been added ");
var choice = window.confirm("Do you want to add the Instance of
this particular Resource ? ");
if (choice == true) {
window.alert("You are going to add a new Instance");
<% Answer=1; %>
window.alert("answer = " + <%= Answer %>);
} else {
window.alert("Thanx for NOT entering the record");
<% Answer=89; %>
}
window.alert("answer = " + <%= Answer %>);
</script>
%>
NOW THE PROBLEM IS
I am always gettin the "Answer" as 89, Irrespective what I choose in
the confirm button.
if i choose "True" to my confirm button, First my "Answer" is printed
as 1 , then it also executes the JSP tag in the "else" clause and makes
my "Answer" as 89.
Kindly help, what is the error ? Is it because I am embeeding JSP in
Jscript ?
regards
gaurav