How to check if two fields contain same value

   —   
This article gives you instructions on how to check if two fields contain same value for when you need to compare two e-mail inputs for same e-mail address
All you need to do is add three fields (two for e-mails, one for the validation message):
E-mail1
  • Column name: email1
  • Attribute type: Text
  • Attribute size: 100
  • Allow empty values: false
  • Form control: E-mail
  • Has depending fields: true
E-mail2
  • Column name: email2
  • Attribute type: Text
  • Attribute size: 100
  • Allow empty values: false
  • Form control: E-mail
  • Has depending fields: true
 Validation message
  • Column name: compare
  • Attribute type: Text
  • Attribute size: 100
  • Allow empty values: true
  • Form control: Label
  • Regular expression: .+
  • Error message: E-mails have to match
  • Visible condition: email1.Value!=email2.Value
  • Depends on another field: true

And create proper form layout to hide the compare field caption, like:
$$label:EmailID$$    $$input:EmailID$$    $$validation:EmailID$$
$$label:email1$$    $$input:email1$$    $$validation:email1$$
$$label:email2$$    $$input:email2$$    $$validation:email2$$$$input:compare$$$$validation:compare$$
Share this article on   LinkedIn

Jan Hermann

I am a support engineer in Kentico and I take care of any issue you have!