Solved

Else If Statement - with one or another variable

Posted on 2004-08-26
2
255 Views
Last Modified: 2010-04-01
Hi, How do I create an if/else statement in which I want it to do the same thing if either of 2 variables are entered? Here is my code:


String mode = request.getParameter("mode");

out.print("<td><center>");
      if (mode.equals("largeimages"))
      {
            String imagenumber = request.getParameter("imagenumber");
            out.print("<a href=\"deleteimages.jsp?mode=" + mode + "&imagenumber=" + imagenumber + "\">");
      } else if (mode.equals("listaccession") OR mode.equals("listaccessionall"))
      {
            String last2 = request.getParameter("last2");
            out.print("<a href=\"deleteimages.jsp?mode=" + mode + "&last2=" + last2 + "\">");
      } else
      {
            out.print("<a href=\"deleteimages.jsp?mode=" + mode + "&series=" + series + "\">");
      }
out.print("<font size=2>Unselect Image</font>");
out.print("</a></center></td>");


Thank you for your help in advance.
AKamauu
0
Comment
Question by:akamauu
2 Comments
 
LVL 3

Accepted Solution

by:
pat5star earned 125 total points
ID: 11908739
    } else if (mode.equals("listaccession") || mode.equals("listaccessionall"))

|| is how you say OR

-Pat
0
 

Author Comment

by:akamauu
ID: 11908872
Thank you ... that worked great.

AKamauu
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
EJB MDB example 4 83
dateFashion java challenge 9 141
org.apache.jasper.JasperException: using jstl in jsp embedded jetty 13 611
own marker interface 1 55
In this article we will learn how to backup a VMware farm using Nakivo Backup & Replication. In this tutorial we will install the software on a Windows 2012 R2 Server.
This article outlines the process to identify and resolve account lockout in an Active Directory environment.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question