Hi,
I want to limit the number of characters the user can enter in the textarea.
An alternative solution would be a character-counter below the textfield.
Any ideas to realize that?
Thanks.
Koepi
Limit number of characters in textfields
Re: Limit number of characters in textfields
You can use javascript to achieve this ... create a file in the "hooks" folder, naming it "tablename-dv.js" (where tablename is the name of the concerned table) and add code similar to this in it:
(where fieldname is the name of the concerned field). Change 40 to the desired limit.
Code: Select all
jQuery(function(){
jQuery('#fieldname').attr('maxlength', 40);
});
AppGini plugins to add more power to your apps:
- DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
- Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
- Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.
Re: Limit number of characters in textfields
Thanks Ahmad, that works fine!
But realize that "maxlenght" doesn't work in IE9/8.
Spent a lot of time to find that out.
Installed IE11 - thats okay (FF also).
My next try: install a character counter below the textfield I want to be limited/counted.
Is this also possible by using the hook folder, or only by adding code directly in the table.php?
But realize that "maxlenght" doesn't work in IE9/8.
Spent a lot of time to find that out.
Installed IE11 - thats okay (FF also).
My next try: install a character counter below the textfield I want to be limited/counted.
Is this also possible by using the hook folder, or only by adding code directly in the table.php?
Re: Limit number of characters in textfields
No it can be added using the same hook file using javascript ... you can find through Google lots of examples on how to implement this ... for example: http://stackoverflow.com/questions/5371 ... n-textarea
AppGini plugins to add more power to your apps:
- DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
- Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
- Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.