Expand my Community achievements bar.

field to be required or not required after answer to another

Avatar

Level 2

I have a few drop-down lists on an Employee form that I am creating with LiveCycle Designer ES.  There are some other fields on the form that should be "user entered - optional" unless a specific value is chosen by the user on the previous drop-down list.  Here is the complete scenerio:

My drop-down list named "Choose status, etc." is a required field that has 4 different choices.  The choices are New Hire, Rehire, Dept./Status Change, and Address Change.  If the manager choses either New Hire or Rehire, I want to require them to complete the next field, which is Confirmation Number.  If they choose Dept./Status Change or Address Change, then I want the Confirmation Number field to be "user entered - optional" .  How can I make one field's required type dependent on the answer to another field?

2 Replies

Avatar

Level 2

Here is something I have used based of the selection of a radio group (Class1)

I put it in the exit event and used formcalc

if

($.selectedMember() == xfa.resolveNode("Class1.Exibitor")) then

Company_Name.validate.nullTest

= "error"

Rep_Name.validate.nullTest

= "disabled"

xfa.form.recalculate(1)

else

Company_Name.validate.nullTest

= "disabled"

Rep_Name.validate.nullTest

= "error"

xfa.form.recalculate(1)

endif

My problem with this is that it does not dynamically apply itself - if you bring focus to the field Rep_Name or Company_Name they will correctly be required or not.