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.