Print Page | Close Window

Compare two input text fields [tutorial]

Printed From: openElement Website
Category:

openElement


Forum Name: User Tutorials
Forum Description: Browse or create a tutorial to get the most out of the openElement software.
Please do not post support questions in this section.
URL: https://forums.openelement.uk/en/forum_posts.asp?TID=1672
Printed Date: Mar 28 2024 at 7:41am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Compare two input text fields [tutorial]
Posted By: Hobby001
Subject: Compare two input text fields [tutorial]
Date 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

https://zupimages.net/viewer.php?id=20/22/y3s3.jpg" rel="nofollow">

https://zupimages.net/viewer.php?id=20/22/tx7e.jpg" rel="nofollow">

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





-------------
https://denislafrance.net/index.en.php" rel="nofollow - https://denislafrance.net https://www.youtube.com/playlist?list=PLWg7A6YtIr7WE2oJe9pX8_3u0FerqJwjo" rel="nofollow - , OE training video



Replies:
Posted By: Hobby001
Date 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

-------------
https://denislafrance.net/index.en.php" rel="nofollow - https://denislafrance.net https://www.youtube.com/playlist?list=PLWg7A6YtIr7WE2oJe9pX8_3u0FerqJwjo" rel="nofollow - , OE training video



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net