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).
After selecting "I Agree" check box: Save button enabled!
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="http://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:
After selecting "I Agree" check box: Save button enabled!
Hi Salaudeen,
ReplyDeleteHow to create custom List form ?
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.
DeleteHi,
ReplyDeleteIn the same way.
how to check if the field is empty or not?. Please let me know
I apprciateyour help.
Thanks
Stacy
Here you Go:
Deleteif($('input[title$='RequiredTextFileld]').val() == ""))
{
alert("Please Provide value for Required Text Field!");
}
Thanks,
ReplyDeleteBut 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
Hi Sir,
ReplyDeleteI 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