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 4624698
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:09:57+00:00 2026-05-22T03:09:57+00:00

ok, here is the story… I have 3 textfield for user to select…. [textfield

  • 0

ok, here is the story…

I have 3 textfield for user to select….

[textfield A][textfield B][textfield C]

and a confirm button, the user need to add three textfield, after that , the user need to click the confirm button…. but based on different select order, the result is different, for example:
A>B>C, I will show red.
When the user select in this order:
B>A>C I will show green.
When the user select in this order:
C>B>A I will show the color blue….

based on different user select order, it will show different color….
But the question is, when I add more and more textfield, how can I implement this logic?
First, I design to have an array , when the user select one textfield, I store the textfield id to array, when user select the second one, I will store in the array, until the user click confirm, I read back the array to display the color….
But I think it will become very big & messy when more and more textfield is added, any better ideas? Thank you.

  • 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-22T03:09:58+00:00Added an answer on May 22, 2026 at 3:09 am

    It’s a bit of a hack, but what I’d be inclined to do is store the selections in a string that gets appended to each time (starting with empty string of course), trimming to the rightmost x characters. Then you can do a simple switch/case statement to determine the color. For example (C# fragments, sort of):

    string selectStr = string.Empty;
    
    void Select(string btn) {
      selectStr += btn;
      selectStr = selectStr.Remove(0, btn.Length - 3);
    }
    
    void Confirm() {
      switch (selectStr) {
        case "ABC" : /* make red */ break;
        case "BAC" : /* make green */ break;
        // etc.
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the story... I have a jQuery function that does something, this function is
So here's the story: I have a QListview that uses a QSqlQueryModel to fill
So here is the story. I have this device that uses Linux and more
Right, here's the story: We have had a website for one of our brands
Here's the story. I have a form with some form fields. Example: name email
Alright, so here is the story.. My organization has a database that we sell
I am linking some stories on FaceBook, but the url I have is: http://webpage.com/single.php?2011/02/04/my-story-here.html
Here's user story: User enters address: Paris, France. Then I would like to display
Here is the story. I have a Debian 5 server automatically starting into a
This issue's story started here: Cannot make memory view because object does not have

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.