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

Question

Question

hide field issue in a table

asked on September 9, 2014

 I got this problem the first row seems ok but when I add row the hide field is not the good one

 

 

here the field rules I used

 

0 0

Answer

SELECTED ANSWER
replied on September 10, 2014 Show version history

If You do not mind the columns showing, then what you can do is basically something like what is done with the code from the following link but modified to disabled and enable the field you want.

 

https://answers.laserfiche.com/questions/62583/Change-the-value-in-a-total-field-when-a-drop-down-is-changed-in-a-table

 

Basically, instead of the lines where they insert the subtotal to the field, you will want to instead replace the value in whatever field you disable and then also disable it, using code like the following:

// To Add the Disabled Attribute
$('.CSSClassName').attr('disabled','true');

// To Enable a field
$('.CSSClassName').removeAttr('disabled');

So basically, for each line, you will need to do that type of modification.

 

Be sure to use the "find" method though, since you only want to effect that particular line.

$(this).find('.CSSClassName input').attr('disabled','true');

$(this).find('.CSSClassName input').removeAttr('disabled');

EDIT:

 

Noticed you need to also worry about required fields. You will also need to add code like in the following linked answer:

https://answers.laserfiche.com/questions/56221/dynamically-change-required-fields

0 0

Replies

replied on September 11, 2014

I tried reproducing this issue with the fields and field rule you specified but could not. What version of Forms are you using? Are there any lookup rules on this form? Any JavaScript?

1 0
replied on September 9, 2014 Show version history

I don't believe that what you are seeing is hiding the field. I think it is just marking the field as read-only. The fact that it shows a grey area where the field is makes me think that. I am having a similar issue though with trying to create a Field Rule using items in a table. I don't think it works. I could be wrong though. I have an open support case with Laserfiche on the issue.

1 1
replied on September 9, 2014

You will not be able to do it that way. once the field rule shows that table column, it will need to show for all those rows, even if it's disabled.

 

You will likely need to use Javascript to handle this. I would take a look at the following link for an idea of how this would be done.

 

https://answers.laserfiche.com/questions/62583/Change-the-value-in-a-total-field-when-a-drop-down-is-changed-in-a-table

 

In the link above, I showed how we can iterate through the rows of a table. You will need to do something along those lines to change up the view based on the Work Type. I would recommend you change this table to instead use the same field for the second value, maybe using Javascript to change the text that is below the field, so that you do not have so many columns with disabled fields. You can however modify the javascript from the link to disable and enable fields based on Work type by adding and removing the disabled attribute to whichever fields require it.

0 0
replied on September 10, 2014

Well the issue is not the fact is hiding or becoming readonly field. it is the fact that if I add another row item, the field that become readonly is not the one it is supposed.

 

on the second and other row the field Work order become readonly in place of field aircraft.

 

So it  sounds an issue with the application

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

Sign in to reply to this post.