Přejít k obsahu  Přejít k hlavnímu menu

Blog / Knowledge base

Updated: 25. May 2020

Merging values ​​from multiple inputs into one

Mailocator allows you to serialize the data submitted from the form into a single field before submitting, which is useful, for example, when submitting a date.


Case study:
Merge month and year into one field and send it to ESP

See how easy it is to merge values ​​from two selections - month and year - into one field and send this field to a third-party tool (newsletter subscription).

Create the necessary select tags and add the necessary options, for example:
<select name="year">
    <option value="1999">1999</option>
    <option value="2019">2019</option>
    <option value="2029">2029</option>
</select>

<select name="mon">
    <option value="jan">jan</option>
    <option value="feb">feb</option>
</select>







Add a hidden input that will contain the combined value of the month and year.

Name the input according to the name of the custom field in your tool and add the prefix opt_, for example opt_date
Add the data-merge attribute and enter the names from the selections for month and year year | mon separated by a value |
Add a class to the input mlctr-ext-merge

<input type="hidden" name="opt_date" data-merge="year|mon" class="mlctr-ext-merge"/>





You can merge any number of values.
For this feature, turn on the Mailocator Extension in the version settings.

RELATED

Action setval - change of values in Mailocator forms

The setval action can be used to dynamically change the default value in pop-ups

Connect and make forms for dialog-Mail

See how to easily connect dialog-Mail and build and setup subscription popup

Changes in the import of discount codes from 1 December 2020

If you use discount codes in Mailocator, please pay attention to the following information

Draw a random discount code

Do you need to draw a random win or a code to gamble popup? Mailocator allows you to easily set the probability to one hundredth of a percent, randomly select a win and deliver it to the email tool.

Launch a campaign using a URL

You can also invoke Mailocator campaigns or designs at any time using a parameter in your site´s URL

Transfer of data from Mailocator to ESP

Sometimes it is useful to provide additional information from Mailocator, usually state, gender, favorite categories, discount code or name and surname. How to do it?