Page 1 of 1

Lock form to prevent changes

Posted: 29 Oct 2014
by Sonoma
Any way to lock a form to lock a form out to prevent editing or changes to form design?would this be basic sp security?

Re: Lock form to prevent changes

Posted: 30 Oct 2014
by Dmitry Kozlov
Hello,

Sure, you can disable fields based on condition via JavaScript. Also, you can create a separate form for a particular SharePoint group and turn fields into readonly state. And finally, you can hanle fd.onsubmit event and prevent form from submission:

Code: Select all

fd.onsubmit(function() {
	if (smth) {
		alert('Your changes cannot be saved now.');
		return false;
	}
	
	return true;
})

Re: Lock form to prevent changes

Posted: 30 Oct 2014
by Sonoma
hank you. I will look into groups.


I did come up with this.

$('#fd_form :input').attr('disabled', true);

It works. Is there a way to modify the SPForm "General Setting" and add a check box that would allow for the user to do this?

""CHECKBOX"" Disable all fields with this code behind it? $('#fd_form :input').attr('disabled', true);