Required, readonly field gets cleared after related items list form gets submitted.

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
eedoh
Posts: 37
Joined: Tue Feb 11, 2014

09 Jul 2014

I have two lists. Cost Records and Pricing. There's related items view for Pricing on Cost Record forms. Cost Records form has only one required field, and that's CR Number. This field is set to readonly through javascript framework (in edit form).

Every time I add new item into the related items view, or edit existing one, Cost Records form reloads, but it clears CR Number value as well (although this is edit form, so CR Number has already been saved into the list, it's not just issue of losing unsaved form data).


Any suggestions

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

10 Jul 2014

Hi,

That is the browser restriction – it doesn’t pass values of disabled fields to the server. So you should enable fields right before the submission in onsubmit handler. Put the following code into JS-editor:

Code: Select all

fd.onsubmit(function() {
  fd.field('Field1').readonly(false);
  fd.field('Field2').readonly(false);
  …
  return true;
});

sfernandez
Posts: 5
Joined: Mon May 19, 2014

23 Dec 2014

does not work despite setear read only = false the field in the submit, another alternative?

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

24 Dec 2014

Unfortunately, I coudn't reproduce the problem. Could you record a video that demonstrates the issue and share it? Please, include the browser's address bar into the video frame.

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests