Can we pass the AEM form object values(eg: entered in textfield) to another AEM form . Please provide an example
Solved! Go to Solution.
Views
Replies
Total Likes
Dear Jadish,
We are very lucky to work on the fantastic AEM Forms framework build by Adobe!
Dear Adobe has number of wonderful API's that let us deliver such asks!
You may need to write a short script set on Root Panel. where you listen on:
guideBridge.on('elementNavigationChanged', function(event, payload) {
//here we can listen for our payload or select element you may wish to select and set
localStorage.setItem('myCustomValue', value)
}
Then once you load the other form you may wish to load the value on
$( document ).ready(function () {
localStorage.getItem('myCustomValue');
})
[1] Docs AEM forms * JavaScript Examples (adobe.com)
Kindest Regards,
Peter
Dear Jadish,
We are very lucky to work on the fantastic AEM Forms framework build by Adobe!
Dear Adobe has number of wonderful API's that let us deliver such asks!
You may need to write a short script set on Root Panel. where you listen on:
guideBridge.on('elementNavigationChanged', function(event, payload) {
//here we can listen for our payload or select element you may wish to select and set
localStorage.setItem('myCustomValue', value)
}
Then once you load the other form you may wish to load the value on
$( document ).ready(function () {
localStorage.getItem('myCustomValue');
})
[1] Docs AEM forms * JavaScript Examples (adobe.com)
Kindest Regards,
Peter
Hi @JADISH
There are various ways you can pass the values entered in text field from one form to another. One approach is already explained by @Peter_Puzanovs, here are the other approaches-
1. Submit to REST endpoint submit option passes the data filled in the form to a configured confirmation page as part of the HTTP GET request. You can add the name of the fields to request. The format of the request is:
{fieldName}={request parameter name}
You can then retrieve the parameter value on the second form like:-
String data= request.getParameter("param1");
Here are the details for using Submit to REST endpoint : https://experienceleague.adobe.com/docs/experience-manager-65/forms/adaptive-forms-basic-authoring/c...
2. You can use browser cookie to save the parameter value in the first form and retrieve values on the other form. Cookie can store maximum size of 4096 bytes.
Hope this helps.
Views
Likes
Replies
Views
Likes
Replies