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

rss

Posted by eedoh - Jul 9 ’14 at 05:34

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

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 8 years 2 months 10 days
    #1 by Dmitry Kozlov Jul 10 ’14 at 03:11

    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:

    fd.onsubmit(function() {
      fd.field('Field1').readonly(false);
      fd.field('Field2').readonly(false);
      …
      return true;
    });
    
  • sfernandez
    Member
    Member for: 7 years 6 months 12 days
    #2 by sfernandez Dec 23 ’14 at 01:32

    [#1]: does not work despite setear read only = false the field in the submit, another alternative?

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 8 years 2 months 10 days
    #3 by Dmitry Kozlov Dec 24 ’14 at 03:34

    [#2]: 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.

Displaying 1 to 3 of 3 messages