Page 1 of 1

Control prompt Input

Posted: May 17th, 2024, 10:09 pm
by amari
Dear Dev Team,
Is it possible to control input when using the Prompt command during data entry? Specifically, I want to ensure the input meets certain criteria as the user types, such as requiring a 4-digit number or a valid mobile number. While validation after the user completes the input is straightforward, I want to restrict input in real-time. Are there any workarounds or methods to achieve this?

Re: Control prompt Input

Posted: May 20th, 2024, 3:52 pm
by justinlakier
Hello,

the Prompt function works to get a string from the user which follows 4 criteria- password, uppercase, numeric, or multiline. Other criteria cannot be added to the prompt. If you want something like a 4-digit number, you can direct the user to a Numeric field of length 4 on the form, where it will be impossible for them to enter a longer number and validation in the postproc can ensure they didn't try to enter a shorter number. However for more complicated validation, like a valid phone number, there is no way for CSPro to ensure dashes are placed correctly as it is being entered, so the only real option is to use validation after the user completes input.

Hope this helps,
Justin

Re: Control prompt Input

Posted: May 20th, 2024, 10:14 pm
by amari
Thanks lot

Re: Control prompt Input

Posted: October 21st, 2025, 3:37 pm
by odette.robleto
creo que deberias intentar declarar una variable alpha()con la cantidad de valores que deseas limitar y asignarle al input esa variable
alpha(55) recibeinput;
recibeinput=input();