I have a scenario whereby I have a cascading dropdown which works well - so if someone selects an "Incident type" from the first dropdown then respective values from the "Incident type - Sub Category field" are displayed. This works well. My scenario is three-fold. Based on the values selected in the Incident type Sub Category field, the respective fields to populate should be displayed.
So as an example - if someone selects:
Accident from the Incident type dropdown, and from the Sub Category dropdown they select Property Damage, - two other fields should be displayed asking them to describe the property damage and also include an estimate cost. Similarly, if they select something else from the sub category dropdown, the respective fields should be displayed. What I also want is if someone selects a sub category and the respective fields are displayed, and they enter text in those fields and they choose another category instead, the already entered text should be reset, as it means they would have selected the wrong category. I am using a form that has tabs whereby I have set on each data cards visibility property, eg: currentTab="UpdateIncident" so only the fields for update Incident will be displayed when I select that tab, similarly I have a tab for Risk Ranking and I set currentTab="RiskRank" for all the cards that need to be displayed on that tab. Because under the visible property for each datacard I already have currentTab=xxxx, I am not sure how to nest an if function with this, to show/hide the respective fields based on the value selected. Finally, I would also have liked to disable submit if based on the hidden fields displayed, if any is blank, disable submit. Hope this does not sound like a mouthfull, but would appreciate any guidance on how to achieve the above. Thanks in advance.