Textarea in our forms? Who has never used it? No one !
And the famous question that arrives thereafter “Yes, but when you enter a very long text, we would like the area to expand … it would be much more beautiful!”
To avoid this kind of scene, we have a simple answer to propose to you. It’s a JavaScript library called
that allows you to have self-expanding textarea.
This library can be downloaded here: https://github.com/jackmoore/autosize
The easiest way is to download the autosize.js file and drop it on the K2 server, in the K2 smartforms Runtime \ Script directory, create a Common directory and drop the library into it.
The next step, add this tip of javascript in the forms where you want to have the extensible auto controls:
That’s it, your textarea are now spreading by themselves!
Before | After |
It’s your turn 😉