Cross-Field validation in K2 SmartForms.

  • 22 January 2014
  • 1 reply
  • 3 views

Badge

Hi,


I have two fields in a View/Form. (e.g. CustomerID and PersonID)


1)When CustomerID has any value, I wanted PersonID to be required field with a red border. When user moves the cursor over the PersonID, it should display a tip that it is required since customerID has a value.


2)When I make CustomerID blank/empty , PersonID  should no longer be a required field. 


I was able to accomplish Step1 using a rule and "View Passes Validation" condition. However, I'm unable to clear this validation error when there is no value in CustomerID field.


Any ideas really appreciated.


Thanks!


 


 


1 reply

Badge +4

You should be able to control the styling of controls using the conditional styling. As making fields required or not required, I cannot see how it can be done unless you hide the person Id field when customer Id is empty. Then use the form/view passes validation to set all properties as required except hidden items. 

Reply