Hi I need a client side validation in my custom activity.

I have a field called name, I want it to be required. So When user clicks the done button in the iframe it will not push through and show an error message. Is this possible in postmonger event reference?

This is my code in reference to clicking the done button

connection.on('clickedNext', save); //Save function within MC

    function save() {

    let inArgs = payload['arguments'].execute.inArguments;

    if(eventDefinitionKey) {
        $.each(inArgs, function (index, inAug) {
            $.each(inAug, function (key, val) {
                inAug[key] = val.replace("eventDefinitionKey", eventDefinitionKey);

            inAug['journeyStepCode'] = getJourneyStepCode();

            if(authTokens && authTokens.token){
                inAug['token'] = authTokens.token;


    payload['metaData'].isConfigured = true;

    connection.trigger('updateActivity', payload);

is there a Postmonger Events Reference where in if a field is null it will not push through and show an error message?

something like

  //go back
  //show error message

1 Answer 1


You can show the error message using any Javascript DOM/CSS manipulation method (it looks like you are already using JQuery so you have a full set of options). Then just send the "ready" event to let JB know that configuration is not done yet :

if(error) {
    // display an error message, highlight form field... Anything you can do with client-side JS

} else {
    // update the payload with your custom parameters

    payload['metaData'].isConfigured = true;
    connection.trigger('updateActivity', payload);

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .