Client side new row bubble form validation before saving

Client side new row bubble form validation before saving

seitekkseitekk Posts: 1Questions: 1Answers: 0

Hi,

I would like to validate certain fields when Save button in bubble editing "create new row" form.
If validation is unsuccessful it should show an error message as a modal window. A user can only read and click Ok to go back to the form to change the fields to make them valid.

I tried to use preCreate event but the row is just being created instead of returning back to the form.

editor.on('preCreate', function (e, json, data) {
              if($("#DTE_Field_coeff").val() == 1) {
                  $("#errorMessageText").html("Coefficient cannot be 1.");
                  $('#errorMessageModal').modal('toggle');

                   if ( true ) {
                        return false;
                   }
               }
});

Please suggest a solution. Thanks in advance.

This discussion has been closed.