Contact Us

A way of implementing resizing of a text area in the process of entering data by a user

Using this method, the text area will change its size in height depending on the number of strings entered by the user.

The resizing of the text area will work on the JQuery script. For implementation, we need to create a DataLabel on the View, for example, with the name “dlResizeJS”, select the Literal option.

We  should create two expressions:

  1. The first expression, for example with the name “exp Resize TextArea” and write our script into it, which is responsible for resizing all TextArea on the form:

  1. Create the second expression, for example, with the name “exp Dynamic TextAreaSize” and also write our script into it. This variable is responsible for resizing the TextArea in accordance with the user input into it:

Expression fields stay empty.

Next, let’s create a rule in which a script must be called upon initialization. To do this, add two “transfer data” rules to it:

We will pass “exp Resize TextArea” in the first “configure” from the Expression tab to the DataLabel “dlResizeJS”:

We will pass “exp Dynamic TextAreaSize” in the second “configure” from the Expression tab, also to the DataLabel “dlResizeJS”:

So, the scripts will be executed successively.


A few words about the script.

The script checks the length and sets the height of the text area.

Also tracks keystrokes on the keyboard. Thus, after deleting lines of text, the height of the text area is reduced based on the number of lines deleted.

Simple translation control using Google Cloud Translate API

This article describes an easy way to translate text in K2 Smartforms using one of the most common translation toolkits – Google Cloud Translate API. This does not mean that this solution is limited to this particular API. You can use any API just by modifying a very simple JS script (download).
Below is the video of how this script works in K2 Smartforms

For convenience, at the end of the article there is a link to download the archive, which consists of a K2 package with an already integrated script and a separate script file. All you need to do is add your API KEY from the Google Cloud Translate API to the parameter of one of the View – BlogPost.ItemView, namely pGoogleCloudTranslationAPIKey. By default, the source and target language options are set to en (English) and es (Spanish), respectively. The languages can be changed in the parameters or simply by setting the parameter values in the URL. The language codes must be from the list supported by this API.


For testing, you can run the form – BlogPost.Form.

As a result, we get an empty form

You need to enter any text in Title or Text and click outside this field. This event will trigger the script launch rule and the text will be translated in parallel control.

Thank you for attention.


For more detailed information please contact –