Disable “Save” Button Until User Selects “I Agree”

Requirement is: Don’t allow the end user to submit a record until they Agree with the terms and conditions by selecting “I Agree”.

So, we’ve to disable “Save” button until the “I Agree” check box is checked! Here is the jQuery script to achieve the same. Just place this code in your custom list form or in Content Editor Web Part (Place it in a Text file, upload and specify the script in CEWP).

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js" type="text/javascript"></script>

<script language="javascript">

$(document).ready(function(){
 //Disable the "Save" button initially
  $("input[value$='Save']").attr('disabled', true);  

 //alert('jQuery Works');


 //Enable-Disable "Save" button based on "I Agree" checkbox value!
   $("input[title$='Agree to Delete this site']").click(function(){
        if(this.checked)
           {
            $("input[value$='Save']").attr('disabled', false);
           }      
        else
           {
            $("input[value$='Save']").attr('disabled', true);  
           }
     }); 

  });

</script>

Code in action: If  “I Agree” check box isn’t enabled:

Disable "Save" Button Until User Selects "I Agree"

After selecting  “I Agree” check box: Save button enabled!

Salaudeen Rajack

Salaudeen Rajack - SharePoint Expert with Two decades of SharePoint Experience. Love to Share my knowledge and experience with the SharePoint community, through real-time articles!

7 thoughts on “Disable “Save” Button Until User Selects “I Agree”

  • That still leaves the save button in the ribbon available.

    Reply
  • Hi Sir,
    I have used this code for disabling ‘Save’ button, but my other outcome button ‘Reviewed’ stopped to work. Sir, please can you help me with this, I want to disable ‘Save button’ but I want ‘Reviewed’ button to work…

    Thank you in Advance

    Inom

    Reply
  • Thanks,
    But its not working. I hope u can me with this. I have field called Minutes which is a TextBox. When the user enter the numbers I want to check the value should not be less than 15. How do i do that using Jquery.
    I Appreciate your help
    Thanks,
    Stacy

    Reply
  • Hi,
    In the same way.
    how to check if the field is empty or not?. Please let me know
    I apprciateyour help.
    Thanks
    Stacy

    Reply
    • Here you Go:

      if($(‘input[title$=’RequiredTextFileld]’).val() == “”))
      {
      alert(“Please Provide value for Required Text Field!”);
      }

      Reply
  • Hi Salaudeen,

    How to create custom List form ?

    Reply
    • Use SharePoint Designer to create a custom list form and place the code below “PlaceHolderMain”. You can edit the page in Browser, add a CEWP and use the above code as well.

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *