View Single Post
Old 05-17-2012, 07:29 PM   PM User | #3
KKLU
New to the CF scene

 
Join Date: May 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
KKLU is an unknown quantity at this point
Thanks. This works -- finally prints True.

Code:
<%!            
        String[] question;
        %>
        <%
            question = request.getParameterValues("question");
            if (question[0].equals("a") && question[1].equals("c")) {
                out.print("True");
            } else {
                out.print("False");
            
            }
          %>
So, I guess the reason this does not work

Code:
if (request.getParameter("question").equals("a") && request.getParameter("question").equals("c")) {
                        out.print("True");
                    } else {
                        out.print("False");
                    }
is because "question" has more than one value, hence needs to be added to a String and then compared?
KKLU is offline   Reply With Quote