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?
Control prompt Input
-
- Posts: 238
- Joined: November 21st, 2022, 4:41 pm
Re: Control prompt Input
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
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