You are viewing limited content. For full access, please sign in.

Question

Question

Tables filled via javascript do not carry their data into next approval step

asked on July 27, 2015

I have built a form that fills tables in via the javascript methods suggested here and by Laserfiche. I have the lookups working and the tables fill correctly. However, that data filled by those processes does not remain when the form is submitted. In the submission screen I can see the empty table rows where the lookup data was but they are empty. The same goes for when the next approver gets the same form. I am able to have the approver click the tables to trigger another javascript lookup and get the fields to (mostly) fill again but that doesn't work as a solution. I would like that lookup info to be converted to "static" info after the initial lookup.

 

Lookup information into single fields is carried forward just like I would expect. How do we get tables that are filled by javascript to keep their data through approval processes?

0 0

Answer

SELECTED ANSWER
replied on July 27, 2015

Hi Jeremy,

You can use the following JavaScript snippet to make those fields read-only and still allow their lookup values to get carried forward:

$(document).ready(function() {

  $('.myFieldClass input').attr('readonly', true);
  
  $('#q11.cf-table-add-row').on('click', function() {
    $('.myFieldClass input').attr('readonly', true);
  });

});

#q11 is the id of the table's add row button. That part of the code makes the field in the newly added form read-only as well.

3 0

Replies

replied on July 27, 2015

Hi Jeremy,

Is the table cell read-only?

0 0
replied on July 27, 2015 Show version history

Yes it was. I tried turning off the read-only and it does carry the data forward. I really do want it read-only but will go without for now. It's strange because "standard" read-only fields with lookups work fine. It's the read-only cells filled with JavaScript that don't work.

However, I have a more serious problem. When I submit the form I notice that a couple of the tables filled by JS lookups are missing their first row. It just is gone. Even, in the summary "Thank You" view after I hit submit those lines are gone. I can submit a separate question for this.

0 0
replied on July 27, 2015

Forms readonly field won't take the custom javascript generated data because fill form user can easily modify the value input from frontend/browser console.

0 0
SELECTED ANSWER
replied on July 27, 2015

Hi Jeremy,

You can use the following JavaScript snippet to make those fields read-only and still allow their lookup values to get carried forward:

$(document).ready(function() {

  $('.myFieldClass input').attr('readonly', true);
  
  $('#q11.cf-table-add-row').on('click', function() {
    $('.myFieldClass input').attr('readonly', true);
  });

});

#q11 is the id of the table's add row button. That part of the code makes the field in the newly added form read-only as well.

3 0
replied on July 27, 2015

Thanks Ege! That code works great. Much appreciated.

0 0
replied on July 27, 2015

Can you redact any information on those tables and share a screenshot of what you are trying to say? That is a bit odd. Maybe you are having the JavaScript act at the wrong time and its messing up during the saving procedure when it goes into your repository

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.