BullGuard Antivirus Sale - 60% Off with openElement !
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: Jun 05 2018
Location: Canada, Québec
Status: Offline
Points: 6208
Direct Link To This Post Topic: Compare two input text fields [tutorial]
    Posted: May 31 2020 at 12:30pm
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 - May 31 2020 at 4:47pm
Back to Top
Hobby001 View Drop Down
Admin Group
Admin Group
Avatar

Joined: Jun 05 2018
Location: Canada, Québec
Status: Offline
Points: 6208
Direct Link To This Post Posted: Jun 01 2020 at 3:34am
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 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.