ADD COMMENT check

評論

2 條評論

  • Avatar
    Christopher Lauss

    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 Method

    function PressAddComment()
    {
    document.getElementsByClassName("pseudoBtnCommentSubmit")[0].click()
    }

    0
    評論操作 永久連結
  • Avatar
    Loren Bratzler

    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;
    }

     

    0
    評論操作 永久連結

登入寫評論。