BullGuard Antivirus Sale - 60% Off with openElement !
Forum openElement Homepage
Forum Home Forum Home >

openElement

> User Tutorials
  New Posts New Posts RSS Feed - Compare two input text fields [tutorial]
  FAQ FAQ  Forum Search   Register Register  Login Login

Topic ClosedCompare two input text fields [tutorial]

 Post Reply Post Reply
Author
Message
Hobby001 View Drop Down
Admin Group
Admin Group
Avatar

Joined: 05 Juin 2018
Location: Canada, Québec
Status: Offline
Points: 5668
Direct Link To This Post Topic: Compare two input text fields [tutorial]
    Posted: 31 Mai 2020 at 13:30
Create two text input field with Required and Email Validation rules.

Create two buttons 
Button one
Custom class: FakeButton

Note: This button will start email validation

Button two
Custom class: RealButton
Display: no



Note: this is the button to configure in your form


On the editing pane top menu, click on Source code


Click on the plus sign to add new code

Name Email validator
Type Javascript
Position EndBody

Add the following javascript code


// compare input text field values and if values are equal send form
function emailvalidate(){
// Read values
var line1 = $('#WE015088d98e input').val();
var line2 = $('#WEf23203d7ea input').val();

// compare values
if (line1 != line2){
// Failure alert message
alert (" Please check email address ");
}else{
// Trigger form validation and send
$('.RealButton').trigger('click');
}
}

// Trigger validation
$('.FakeButton').click(
function(){
emailvalidate();
}
);


Mandatory: Replace the values in red with your text field IDs





Edited by Hobby001 - 31 Mai 2020 at 17:47
Back to Top
Hobby001 View Drop Down
Admin Group
Admin Group
Avatar

Joined: 05 Juin 2018
Location: Canada, Québec
Status: Offline
Points: 5668
Direct Link To This Post Posted: 01 Juin 2020 at 04:34
This topic is locked.  If  you wish to open a discussion or ask questions about it, please open a new topic
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 10.11
Copyright ©2001-2012 Web Wiz Ltd.

This page was generated in 0,032 seconds.