Quantcast
Channel: Adobe Community : All Content - LiveCycle Designer
Viewing all articles
Browse latest Browse all 5571

Table validation - Advice on best approach please? :)

$
0
0

Hi All - would appreciate some advice please...

 

I have a (static) table in my form as per image below:

 

Impact Table.JPG

 

Each drop down is the same, the user can choose "Minor", "Moderate", "Significant", "Major" or "Intolerable". When they make the selection I need several things to happen:

 

  1. The background color of the cell needs to change "Minor" = green, "Moderate" = amber, "Significant"= amber, "Major"= red or "Intolerable"=red.
  2. The selection should auto populate everything to the right with the same value as selected - Eg if a user selects "Major" on the second cell of the top row (Finance) then all the cells to the right should default to "Major" and change colour accordingly.
  3. The selection needs to set the available drop down choices so as to ensure the impact rating can only increase over time - Eg If a user selects "Major" all remaining drop downs on that row (to the right of the selected dd) only have the option to select "Major" or "Intolerable". The row should be blanked if the user subsequently changes a selection the result of which means the rating has got less over time - meaning the row needs to be completed again.

 

The drop down values are bound to specific numbers ("Minor" =  1, "Significant" = 2 etc) and this needs to remain the case as the values are used in the xml at a later stage.

 

I had managed to get the color change working, and had tried to implement a 'Switch' type statement to set the dropdowns (number 3 above) this worked if the user made selections according to the rule regarding impact only getting worse over time but I got some very strange behaviour when the user subsequently changed a selection and 'broke' the rule . I have since deleted all the javascript to start afresh.

 

My question is this: what would be the best approach to achieve what I want to do?


Could this be done in an efficiant way using a function / script object or suchlike?

 

I would be very grateful if anyone could suggest a method, supply a code snippet maybe or even write the code for one cell for me to paste into all the others ?

 

Here is the form : https://www.dropbox.com/s/ncvq9cyoqolh2tn/BIA%20Impacts%20Table.pdf?dl=0

 

Many thanks

 

Ellis


Viewing all articles
Browse latest Browse all 5571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>