What happens if you select the "validate always" option? Does that work for you?
In your script, validation does not take place while the user enters data into a custom dialog's input fields, you can only test it after the fact and re-display the custom dialog if there was an input error, so you may want to simply modify your script to test the value yourself or design a input layout that is displayed as a pop-up window with the new window script step instead of a custom dialog.
Thank you PhilModjunk, if I select "validate always" that'll work, but I also need the user to insert a positive number only (and no zero), so I found out that using the "Sign" function will help validate the field even if "validate always" is not selected. Infact, it returns 1 only for a positive numeric character, any other character will return 0.
Thank you for your help!
The problem with using Sign() by itself is that text is still allowed mixed with the numbers, including spaces. Garbage, including invalid characters and carriage returns can also be pasted into the field mixed in with numbers and they will produce 1 for Sign().
I would suggest you just remove the garbage by applying auto-enter calculation with:
Filter ( Self ; "0123456789" )
... and use that in conjunction with Sign() as validation but I would specify the validation calculation as: Sign ( Self ) or IsEmpty ( Self).
Include decimal in the Filter() string if allowed (so User can type .34 if acceptable) and be sure (after returning to the auto-enter tab) to uncheck 'do not replace existing value ...).
It was early ... GetAsNumber ( Self ) to restrict from garbage and then your validation calc.