Mailocator
menu

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.

HAS THIS ARTICLE HELPED YOU?

  

Mailnatives, s.r.o. with IČO 07891768 is registered at the Regional Court in Hradec Králové under the file number C 43368