Dynamic content format and range

It would be nice to be able to set an input’s Content Format and Range parameters dynamically.

My use case is that I have different metrics in the dropdown. They can all accept numeric input, but some should be decimal with no range and some should be integers with a tight range. For example, “height” would accept any decimal (ideally I could define a range, but it’s not critical) whereas “happiness” would accept any integer between 1 and 7 inclusive.

The only way I can see now to have different input validation is to use different inputs, but then I have to double up all of the logic to refer to two different elements. I’d rather just use a condition.

1 Like