Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Experience Manager Champion Program are open!

Add validation on tab key

Avatar

Level 3

We have a requirement on tab key, is to trigger the empty validation rule if the field are empty. It should function like on blur event. I tried this by checking the required field checkbox. But that option is not solving tab key validation. Is there any OOB functionality on this ? or Do i need to write rules ?

  • [Click] to next field or [Tab] to next field will trigger data field rule validation.

Thanks in advance,

Regards,

Chandra

2 Replies

Avatar

Level 8

try allowBlank = false; in case it doesnt work then, you definitely need to write a listener. Refer to the link https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/reference-materials/widgets-ap...?

Avatar

Level 7

Hi,

Do you mean in an adaptive form?

If so you can do something like the following:

window.addEventListener("bridgeInitializeStart", function (evnt) {

   // get hold of the guideBridge object
   var gb = evnt.detail.guideBridge;

   //wait for the completion of adaptive forms
   gb.connect(function () {

   //this function will be called after adaptive form is initialized


   gb.on("elementFocusChanged", function (event, data) {

     // validate field

  });

  });

});