3

In SharePoint 2013 Designer workflow on Rejected request; I need to make the comment field required. How do I do that?

0

Create a new editform and add JavaScript to the form.

In your code, check the value of result task. Use the PreSaveAction() to return true if it's approved, and make a condition for the reject status.

Example:
editformXXXX.aspx

<script type="text/javascript">
    function PreSaveAction() {  
        var value = $("select[title='task result'] option:selected").text();
        var value2 = $("textarea[title='Body']").val();

        if (value=="Approuvée") { 
            return true; 
        }
        else {
            if(value2 != "") {
               return true;
            }
            else {
                alert('Please give a comment');
                return false;
            }
            return false;
        }
    } 

</script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.