#1 2016-11-17 06:04:36

Registered: 2016-05-16
Posts: 151

How to check if a Date input is empty or null?

this code

If "[Input1.Value]" "==" ""


not work!



#2 2016-11-17 10:12:21

From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,717

Re: How to check if a Date input is empty or null?

Hello Joshua,

The Date input is a bit special in comparison with others. This is mainly because their "Value" are not an string, but a Javascript Date variable, so they can't be an "empty" string or "null" value, and this is why the above code doesn't work like in other inputs controls.

On the other hand, the behaviour of the Date input depend on the browsers' vendors implementation. For example, Firefox allow us to "erase" the input date/text (not the associated Date variable), but Chrome only allow us to change the date value to another. Other browsers like the Android's webview doesn't allow to write into the Date input, but offer an specific dialog to choose a Date value.

When we deal with the Date input we must create an App Builder's Date variable from the Input Value using the NewDate action. Then we can use all the Date related actions, for example, to get the selected or current Date input year, month, etc. Onh the other hand we must always validate the user's input in the server side if exists.

Hope this information can help you Joshua, please, go ahead if you have any further question.


Board footer

Powered by FluxBB

Copyright ©2018 DecSoft. All rights reserved.