Copy fields on wizard

Hello,

I'm using a wizard template on a Public Forms. I want to be able to copy the field from the first tab into the second second one for example, how do I copy fields?

In this case the last tab would be a "Summary" section where users would be able to see all entered data. I'm not finding a way to copy the fields.

Please assist.

I'm not seeing a way to copy an existing field. What I'm doing is to create a new field on the wizard tab called summary and setting the values of these fields based on the other fields on the form. Not ideal but seems to do the trick, do you have another suggestion? Is it possible to copy fields from one tab to another?

This is the workaround that I'm doing.

1 - Created field First Name on Tab 1 & on Summary Tab created another field with internal name of Friendly First Name

2 - On tab change running the following code:

fd.rendered(function() {  

fd.clear()
     
fd.container("Wizard0").widget.$on("update:startIndex", function() {
            
      c = fd.field('fName').value;
      
      fd.field('FriendlyFName').value = c;
});


function LockSectionResults() {
        fd.field('FriendlyFName').disabled = true;
         $(fd.field('FriendlyFName').$el).find('input').css('-webkit-text-fill-color', 'black');
       
    }
    

LockSectionResults();
     

});

Question is there a way to run the code so that it only runs on a specific tab instead of running in all tab changes?

Hello @adasilva,

You can add the condition to check the current tab index like this:

fd.container("Wizard0").widget.$on("update:startIndex", function() {
    //check that the current tab index is 2 (third tab)
    if (fd.container("Wizard0").widget.activeTabIndex == 2){
        //your code here
    }
})

Note, that tab index count starts from 0.