Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Pre populate data in touch ui dialog on click of multifield add button


Level 3

Hi All,


I have a requirement where i have to pre populate a field inside multifield everytime "add" button is clicked. any guidance is appreciated



4 Replies


Community Advisor

Hi @annkitaaggarwal 


You can write a simple on click event which can be triggered when someone clicks on the "Add" button in multifield. But what value it should populate? Where should we get this value?


Level 3

i need to specify id there, where author can copy and use it to link if needed. can you please help me with a code snippet


Community Advisor

Hi @annkitaaggarwal 


Please make sure your multifield node has the granite:class property with class name as "multifield-click" as the same class is referred in code.




Here is a sample code:


(function ($, $document) {
"use strict";

$document.on("dialog-ready", function () {

$(".multifield-click .coral3-Button--secondary").click(function(){
alert((Math.random().toString(36).substr(2, 9))); // Take this id and append in the input field where necessary.


})($, $(document));



Level 3

Thanks, but can you guide me like, how to write the snippet for prepopule the dialog field on click on add button.

i am getting the alert, but not able to apend it with the field