• Home
  • Blog
  • Documentation
  • FAQ
    • Pre-Sales Questions
  • Log In
  • Get Easy Forms
  • Home
  • Blog
  • Documentation
  • FAQ
    • Pre-Sales Questions
  • Log In
  • Get Easy Forms
home/Knowledge Base/Developers "How To's"/How to compare two fields to pass the validation (jQuery Validation)
Popular Search:Getting Started

How to compare two fields to pass the validation (jQuery Validation)

2761 views 1 June 1, 2020 admin

To match two fields with the jQuery Validation plugin and the “equalTo” method just follow the next steps:

1. Go to Forms -> Actions -> Settings -> UI Settings -> Load Javascript File and Enter the absolute url to the following file:

https://www.example.com/static_files/js/demo/jquery.validation.equalTo.js

Note: Don’t forget to use your domain name.

2. With the Form Builder add the following Css Class to both fields to compare:

– To the first field (e.g. Password) add the Css Class: first_field
– To the second field (e.g. Confirm Password) add the Css Class: second_field

And that’s it! Test your form!

How to Customize the Validation Error Message

First, I suggest copying our demo javascript file outside the application, and update its absolute URL on Form Settings -> UI Settings.

Then, to customize the validation error message, just edit the text of this line:

$.validator.messages.equalTo = 'Please enter the same value again.';

And if you want to change the css class names, just replace ‘first_field‘ and ‘second_field‘ in the following lines:

$.validator.addClassRules('second_field', {
    equalTo: ".first_field"
});

Then do the same with the Form Builder.

That’s all!

This example introduces you how to use the jQuery Validation plugin with Easy Forms; of course, you can create your own validation rules and use them with your forms.

Ref. | jQuery Validation Plugin

Was this helpful?

1 Yes  No
Related Articles
  • Customize the Landing Page, Login Page and Application design
  • How can I add custom css styles to radio buttons?
  • How To remove “For more details please go here” from the email notifications
  • How to set the PHP CLI path in the application
  • How To Change the Login Page Slogan
  • How To Remove the Logo from the Form page

Didn't find your answer? Contact Us

Leave A Comment Cancel reply

You must be logged in to post a comment.

Developers "How To's"
  • How to compare two fields to pass the validation (jQuery Validation)
  • Customize the Landing Page, Login Page and Application design
  • How can I add custom css styles to radio buttons?
  • How To remove “For more details please go here” from the email notifications
  • How to set the PHP CLI path in the application
  • How To Change the Login Page Slogan
View All 17  
Popular Articles
  • How to Show/Hide HTML elements with Conditional Rules
  • How to enable / disable DEBUG mode
  • How to Submit a Form as WhatsApp Message
  • How to update Form Stats from the command line
  • How to compare two fields to pass the validation (jQuery Validation)
KB Categories
  • Add-Ons
  • Advanced Techniques
  • Common Issues & Troubleshooting
  • Developers "How To's"
  • Getting Started
  • How To

  How to enable / disable DEBUG mode

How to clear the application cache from the command line  

About Easy Forms

With Easy Forms you can create unlimited web forms and most importantly the complete management of them without paying monthly fees

Resources
  • Knowledge Base
  • Documentation
  • Pre-sales Questions
  • Blog
Useful Help Links
  • Get Easy Forms
  • Live Demo
  • License Terms
  • Contact Us
Frequent Visit Links
  • Pre-Sales Questions
  • System Requirements
  • Installing Easy Forms
  • Upgrading Easy Forms
  • Privacy Policy
  • © 2015 - 2024 Baluart EIRL. All Rights Reserved.

Popular Search:Getting Started