Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6252429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:48:00+00:00 2026-05-24T13:48:00+00:00

This page a user must choose between one of 2 checkboxes 5 times. So

  • 0

This page a user must choose between one of 2 checkboxes 5 times. So I wrote this:

        if (box1a.isSelected() == true || box1b.isSelected() == true) {
            if (box2a.isSelected() == true || box2b.isSelected() == true) {
                if (box3a.isSelected() == true || box3b.isSelected() == true) {
                    if (box4a.isSelected() == true || box4b.isSelected() == true) {
                        if (box5a.isSelected() == true || box5b.isSelected() == true) {


                                 with some other things he does when it is true.


        } else {
            new Error("You must select an answer at all the questions");
        }

Then he only returns a error if you don’t check one of the top checkboxes. Then cleary I need a while loop in there but i don’t know how to uhm do it. I know how a while loop works but don’t know how It would look in this situation. Please help

Also now I have to do the same with text fields and using th same methode that I got answered by you guys doesn’t work. any advise?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T13:48:00+00:00Added an answer on May 24, 2026 at 1:48 pm
    if ((box1a.isSelected() || box1b.isSelected()) &&
       (box2a.isSelected() || box2b.isSelected())  &&
       (box3a.isSelected() || box3b.isSelected())  &&
       (box4a.isSelected() || box4b.isSelected())  &&
       (box5a.isSelected() || box5b.isSelected())) 
       {
          //true stuff
       }
       else 
       {
           new Error("You must select an answer at all the questions");
       }
    

    You should never shouldn’t test for true with ==. It is poor style, better to just use the return value from isSelected()

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a normal marked up HTML page where an user can choose one
My universal app has a settings page, wherein the user must choose a theme
I have this PHP page where the user can select and un-select items. The
now I can make it work with user-profile.tpl.php page,all this page does is to
my structure is like this: master page aspx(web form) ascx(user control) I have a
Here is my scenario. User fills out this large page which is dynamically created
I have a Login page that captures User input like this. MD5calc ss =
This is how my web page looks like: PosisionDataView is a web user control,
A pleasant user experience requires a page to load very fast. This can be
I am trying to send user to previous page history.go(-1). This works fine in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.