Check if 0 is in input field
Question
Application Type
Mobile

I have an number input field in a container.  When they trigger an action, I want to be able to tell if they didn't enter anything or if they entered 0.  For this form I need them to enter something, and that number CAN be 0, but they can't enter nothing.  Not sure how to tell the difference between and entered 0 and nothing entered.  Any help would be appreciated.

Now that I posted this, I found the solution.

Outsystem checked the value and couldn't tell the difference between null and 0.

So I just used Javascript to check the value length (since null is 0 and 0 is 1).

Then I saved that value and when the input was brought back to the screen I set the inputs value back to 0 if that is what they entered.

Hi David, Can you please explain in detail with a screenshot or share the oml?

Now that I posted this, I found the solution.

Outsystem checked the value and couldn't tell the difference between null and 0.

So I just used Javascript to check the value length (since null is 0 and 0 is 1).

Then I saved that value and when the input was brought back to the screen I set the inputs value back to 0 if that is what they entered.

That's good work there David.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.