Bug with readOnly properties

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
PSB
Posts: 15
Joined: Thu Oct 25, 2018

01 Dec 2018

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!

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

03 Dec 2018

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
Cheers

PSB
Posts: 15
Joined: Thu Oct 25, 2018

08 Dec 2018

thanks for livehack. question is closed.

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 14 guests