Required with Min Char

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
dharbitindy
Veteran Member
Posts: 101
Joined: 2019-05-26 18:38

Required with Min Char

Post by dharbitindy » 2020-08-28 16:28

Hello,

I'm looking for a way to require a minimum number of characters in a required field. For instance, I have a text field that is required to have information typed into it, but anyone can just type the letter A into it for example and the field will be satisfied. I know that I cannot force someone to put meaningful sentences in the field, but at least I can force a minimum amount of characters perhaps. Any ideas would be appreciated.

Thank you,
David

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1817
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Required with Min Char

Post by jsetzer » 2020-08-28 18:01

Code

Code: Select all

// file: hooks/TABLENAME-dv.js
$j("#FIELDNAME").attr("minlength", 3).attr("required", "required");
On save *

chrome_6Xlqgb0DRG.png
chrome_6Xlqgb0DRG.png (8.71 KiB) Viewed 8305 times

* Should be localized automatically
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

dharbitindy
Veteran Member
Posts: 101
Joined: 2019-05-26 18:38

Re: Required with Min Char

Post by dharbitindy » 2020-08-31 16:16

That is awesome Jan. Thank you!

David

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1817
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

SOLVED: Required with Min Char

Post by jsetzer » 2020-08-31 17:35

Great, thx!
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

Post Reply