Implement a custom strategy to enable autosave for adaptive forms

You can implement a custom event to trigger the autosave functionality. Perform the following steps to create and implement the custom event:

  1. Create client library and client library folders. For detailed steps, see the Using Client-Side Libraries document.

    For example, the following script uses the custom emailFocusChangeevent to trigger the autosave functionality:

    window.addEventListener("bridgeInitializeStart", function (){
        guideBridge.connect(function () { guideBridge.on("elementFocusChanged", function (event,data) {
            if(data.target.name === 'Email') {
                guideBridge.trigger("emailFocusChange");
            }
        });
       });
    });
    
    NOTE
    A category property is defined while creating the client library folders. Keep the value assigned to category property handy.
  2. Open the adaptive form in author mode.

  3. In the edit mode, select a component, then select field-level > Adaptive Form Container, and then select cmppr .

  4. In th properties, open the Basic section. In the Client Library Category box, enter the value of the category property defined while creating the client library folders.

  5. Open the Auto Save section. In the Auto save after this event box, specify a custom event already defined in the client library. Click OK.

Experience Manager