I've created a canvas app, and part of it has fields for 6 different subsidiaries. The user is asked to enter what percentage of time they spend working for each of the subsidiaries. The total needs to add up to 100%, and I'd like to validate that before allowing the form to be submitted.
Currently I have a hidden label named lblHourSum, which has the following set in the text property:
Value(
(DataCardValue5.Text) +
(DataCardValue6.Text) +
(DataCardValue7.Text) +
(DataCardValue8.Text) +
(DataCardValue9.Text) +
(DataCardValue10.Text)
)
Then at the bottom of my form I have another text label which stays visible until the total reaches 100%, named lblNotice:

Here is the visible property of lblNotice:
!(Value(lblHourSum.Text)=100)
This works, but feels clunky to me. It has also has the problem of not actually preventing the user from submitting if the value doesn't equal 100, as I don't have any mechanism in place to stop that.
Instead of having lblNotice visible at all times until the total reaches 100, I'd instead like to have a notice come up only if the user tries to submit when the value of lblHourSum is anything other than 100. This could be either through the red error message banner at the top or by using the existing lblNotice. But I also need it to prevent submission if not equaled to 100.
Hopefully that makes sense. Thanks for any direction you can provide.