Page 1 of 1

Bug with readOnly properties

Posted: 01 Dec 2018
by PSB
SP2013, last CU + Forms Designer Client 3.1.4
______________________________________________

1. create library with document set content type. Add text field "Test".
2. Open forms designer and create new form with button:

Code: Select all

fd.field('Test').value('testtesttest');
fd.field('Test').readonly(true);
3. create new list item and click on button
4. open new item - field "Test" is empty!

Re: Bug with readOnly properties

Posted: 03 Dec 2018
by Nikita Kurguzov
Dear PSB,
This is not really a bug, it's just one of SharePoint quirks and how it processes forms. If the field is set to readonly, SharePoint considers field inactive and empty on submit, so you just need to manually set all readonly fields to editable when you submit the form, just add this to JS editor:

Code: Select all

fd.onsubmit(function () {
  fd.field('Test').readonly(false);
  return true;
});
More about this here - https://spform.com/javascript-framework ... ynamically

Re: Bug with readOnly properties

Posted: 08 Dec 2018
by PSB
thanks for livehack. question is closed.