numeri or alpha fix
-
ahmad
- Posts: 2
- Joined: July 11th, 2021, 12:46 am
numeri or alpha fix
how can we fix numeric or alpha ?when we enter data then box take only numeric or alpha. Kindly share the command or logic.
-
aaronw
- Posts: 571
- Joined: June 9th, 2016, 9:38 am
- Location: Washington, DC
Re: numeri or alpha fix
You can use a regular expression to prompt the user that the alphanumeric text field only accepts alpha or numeric chars.
helps: https://www.csprousers.org/help/CSPro/r ... ction.html
blog post: https://www.csprousers.org/posts/2019-0 ... sions.html
Example:
helps: https://www.csprousers.org/help/CSPro/r ... ction.html
blog post: https://www.csprousers.org/posts/2019-0 ... sions.html
Example:
if not regexmatch(ALPHA_ONLY_FIELD, "^[a-zA-Z]+$") then
errmsg("Field only accepts alpha characters");
reenter;
endif;
if not regexmatch(NUMERIC_ONLY_FIELD, "^[0-9]+$") then
errmsg("Field only accepts numeric characters");
reenter;
endif;
errmsg("Field only accepts alpha characters");
reenter;
endif;
if not regexmatch(NUMERIC_ONLY_FIELD, "^[0-9]+$") then
errmsg("Field only accepts numeric characters");
reenter;
endif;