Conditionally Convert Numbers to String

What would be the best approach for this challenge?

CHALLENGE: Create an assessment form, based on slider fields, that have virtually endless number ranges. See test form here. Then, based on the final numeric value from each field, select a letter. Combine all the letters into a final value.

EXAMPLE:

  • If Slider 1 Value <= 3, Set first letter in final field string = “h” (lowercase h)
  • If Slider 1 Value <= 5, Set first letter in final field string = “H” (Capital H)
  • If Slider 1 Value <= 7, Set first letter in final field string = “c” (lowercase c)
  • Else, Set first letter in final field string = “C” (capital C)
  • If Slider 2 Value <= 3, Set SECOND letter in final field string = “e” (lowercase e)
  • If Slider 2 Value <= 5, Set second letter in final field string = “E” (Capital E)
  • If Slider 2 Value <= 7, Set second letter in final field string = “d” (lowercase d)
  • Else, Set SECOND letter in final field string = “D” (capital D)
  • If Slider 3 Value <= 3, Set THIRD letter in final field string = “e” (lowercase e)
  • If Slider 3 Value <= 5, Set third letter in final field string = “E” (Capital E)
  • If Slider 3 Value <= 7, Set third letter in final field string = “i” (lowercase i)
  • Else, Set THIRD letter in final field string = “I” (capital I)

So, depending on the slider values, a text string input field could be HeE, CdI, or something like that.

POSSIBLE SOLUTIONS
1. Hooks seem most appropriate, but I’m an old programmer sludging my way through this and cannot seem to get it to work. If this is best, your recommendation on structure or best tutorial is appreciated.
2. Multiple Forms w/ Conditional Logic seem likely an option. I’ve done this before with limited values, but I think this would get really ugly with the wide range of possible numbers.
3. Something Else? Is there something obvious I am overlooking or any better way?

I really want to avoid yet another plugin and/or extra fees. Any recommendations or guidance is appreciated!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.