We're looking to convert the what used to work for validating that the comment box is not blank when a user is rejecting a form no longer works in the new designer, as stated in the documentation for the new form designer.
$(document).ready(function () { $(".Reject").click(function () { if ($("#comments").val() == "") { alert("Please enter a comment before selecting this action"); return false; } }); }
We're wanting a new forms editor js version of this, that we would think should look something like this
LFForm.onFormSubmission(function () { if(LFForm.findFieldsByClassName("comments") == "" )( alert('Please enter a comment before selecting this action') return false; ) //console.log(LFForm.findFieldsById("comments")); });
Except onFormSubmission doesn't seem to be getting triggered and there doesn't appear to be an onclick event yet supported to just check for a '.Reject' to be clicked.