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

Discussion

Discussion

Read Only Field In Multi-Row Calculation

posted on January 12, 2017 Show version history

Good Afternoon,

I need some help getting a form to work properly. I have a table where I am performing a calculation on each row in the table. I need the calculated field to be read-only in each field. Using my limited Javascript knowledge, I can get the first one to become read only. However, when I add another row, it is editable. 

 

Thanks in advance!

 

0 0
replied on January 12, 2017

Hi Doug,

Is there a reason you don't want to use the built in 'read-only' field option for the field? If you add a class on the desired read only column to say "readOnly". Then in your javascript section add:

 

$(document).ready(function() {
  $(".readOnly input").attr("readonly","readonly");
  $(".cf-table-block").on("DOMNodeInserted", function() {
     $(".readOnly input").attr("readonly","readonly");
  });

});

 

3 0
replied on January 12, 2017

Thanks! Worked like a charm.

When I applied the built in read only, it would not perform the calculation. When I removed it, the calculation worked. On Form 10.1

0 0
replied on January 12, 2017

No problem!

You are not allowed to follow up in this post.

Sign in to reply to this post.