I am trying to set a maximum value in a field based on a selection from a drop down menu in another field. In other words, there are three selections in the drop down menu (0-2, 2-10, and 10+). If they select 0-2 then the maximum amount allowed in another field is 10. If they select 2-10 then the maximum amount is 15 and if they enter 10+ then the maximum amount is 22. I would like a message box to appear and state that the amount of maximum vacation is .... only if the amount in that field exceeds the maximum value.
If the amount in field2 exceeds the maximum value it should be reduced to the maximum amount based on their selection from the drop down menu.
Field1 is the dropdown menu field
Field2 is the field with the maximum value based on the dropdown menu selection (By the way, field2 is automatically calculated from two different fields so people will not be able to manually input it)
if (filed1.rawValue eq "0-2") and if (field2.rawValue>10) then
xfa.host.messageBox("Maximum Vacation Time is 10");
this.rawValue = 10;}
elseif (field1.rawValue eq "2-10") and if (field2.rawValue>15) then
xfa.host.messageBox("Maximum Vacation Time is 15");
field2.rawValue = 15;
elseif (topmostSubform.Page1.P.DropDownList1.rawValue eq "10+") and if (field2.rawValue>22) then
xfa.host.messageBox("Maximum Vacation Time is 22");