aspose file tools*
The moose likes JSP and the fly likes confirm message in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "confirm message in JSP" Watch "confirm message in JSP" New topic
Author

confirm message in JSP

nuthan kumar
Ranch Hand

Joined: Feb 14, 2006
Posts: 47
Hi,
I need to write a JSP code for the follwoing logic

int count = get from database
if(count <0)
{
show confirm message
if(true)
do something 1
else
do something 2
}

I tried like this
if( (mlMCOList != null) && (mlMCOList.size()>0) )
{
%>
<SCRIPT language=JavaScript>
var answer;
answer = confirm('Are you sure?');
alert(answer);
if(answer == true){
<%
System.out.println("yes");
%>
}
<%
}

but it is not working .. can any help me in this ..?

Thanks in advace
Nuthan
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61766
    
  67

You can't mix Java and Javascript in a JSP like that and expect it to act serially.

Please read this article to find out why.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: confirm message in JSP