Alphanumeric [message #689473] |
Thu, 18 January 2024 03:38 |
siva27
Messages: 41 Registered: April 2007 Location: Chennai
|
Member |
|
|
Dear All,
I have developed form, for password change and which is working fine.
Now new requirement that when they are saving password should be Alphanumeric and min should be 8charaters.
Please let me know, how can I proceed.
Thanks,
-
Attachment: form.JPG
(Size: 13.52KB, Downloaded 1352 times)
|
|
|
|
Re: Alphanumeric [message #689475 is a reply to message #689474] |
Thu, 18 January 2024 07:52 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
One option is to create a function which accepts password (as user types it), performs various validations (its length, whether it contains letters and digits only, whatever you want) and returns
- Boolean: true (password is OK) or false (password isn't OK)
- number: 1 (OK), 0 (wrong)
- string, which contains error message ("password should be 8 characters long, yours is 3" and similar)
Call that function from WHEN-VALIDATE-ITEM triggers on "new password" items (as you have to re-type it; check whether retyped password matches previously entered value - add that into function as well, so it'll actually accept two parameters) and either allow saving, or RAISE FORM_TRIGGER_FAILURE with appropriate message.
|
|
|
|
|