ADD COMMENT check
Is there a way to check that a user has clicked on the ADD COMMENT button after they have added a comment?
I have had a recent spate of users adding comments to the comment box, but not clicking on the ADD COMMENT button, so their comment is not saved. Is there something that I can check before submit to remind them to click on the ADD COMMENT if they have entered text in the comment field.
They do not always add a comment.
-
Hi,
I had the same problem and fixed this with a littel JS and a rule at "Before Submit".
When you click the Button "Submit", "Add Comment" will be pressed by the JS.
Rule: IF(<a mandatory Filed> is not emty)
then Execute Methodfunction PressAddComment()
{
document.getElementsByClassName("pseudoBtnCommentSubmit")[0].click()
} -
Here is another method of doing this if you want to inform the user that they forgot to press the "Add Comment" button and stop the Submit process. This can be added to the Javascript for an individual form or to the Shared Javascript if you want this to be available on all forms in your process. I like using this method because after the user has this happen to them a few times, they will start remembering to press the "Add Comment" button!
eFormEvents.onBeforeSubmit = function (callback) {
var comments=getFieldNameObject("Comments");
var currentval=comments.val();
if(currentval!="")
{
ShowMessage("You have an unsaved comment on the screen. Please click the Add Comment button to save your comment.")
callback (false);
return;
}
// This callback is mandatory for the form submission. If it is not called, the form will not submit
callback (true);
}
function getFieldNameObject(fieldName)
{
var fieldObj;
eFormHelper.getField({ fieldId: fieldName }, function (result) { fieldObj = result.data; });
return fieldObj;
}
Please sign in to leave a comment.
Comments
2 comments