How to show error message when the value in the text field is less than zero

hi i need small help for my model
i want to show error message when it is less than zero and again it should show number after pressing up button. i have done lot of ways but not getting it. please see my model and help me out if you know it. i have uploaded my file nagabhyru.sivaharsha.rp (53.4 KB)

Hi,
Here’s my suggestion - I hope I understood you correctly.

nagabhyru.sivaharsha - v2.rp (54.3 KB)

I saw you had a second state for your Dynamic Panel which was unused - so I decided to use that for the ‘Error’ state. So the Dynamic Panel has 2 states:

  • Show the number; or
  • Show the error message instead.

Whenever the UP or DOWN button is pressed, I fire a ‘Move’ event on the Dynamic panel. This might seem like a hack, but it allows me to put all the logic for deciding which State of the Dynamic Panel to show in one place and call it from either button.

The Move event handler on the Dynamic panel Shows the Number or the Error message depending on the current value.

Note that I didn’t stop the user from continuing to decrease the number when it is less than zero. You could do that by disabling the DOWN button from the Move handler in the Dynamic Panel.