1
0
-1

Client is using Adobe Analytics for metrics. They need to be able to record failed field level validation. i.e. if the user enters wrong info for zip code (zip code that doesn't exist), the validation will fail and we need to capture that.

In composer this could probably be achieved using a business rule, but not sure how this could be accomplished in Maestro. In addition, the validation rule fires more than once, so I need to be able to record only the first time it fails.

Any suggestions?

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Hi,

      You could shadow each input field you want to treat this way with a separate data field, and put code like this in a validation rule for the input field :


      if (data.textField != 'ok') {
        if (Util.isBlank(data.textfieldvalidationerror)) {
          data.textfieldvalidationerror = 'Field was not ok';
        }
        return 'Must be ok'
      }
      return true;

      Make sure you tick 'Include in Submission Data' for each data field so it will be sent with the form XML.

        CommentAdd your comment...