mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
When adding a contact, flag duplicate or invalid e-mail addresses
This commit is contained in:
@@ -148,7 +148,10 @@ ob_start();
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-envelope"></i></span>
|
||||
</div>
|
||||
<input type="email" class="form-control" name="email" placeholder="Email Address" maxlength="200">
|
||||
<input type="email" class="form-control" name="email" id="contact_email" placeholder="Email Address" maxlength="200" onfocusout="contact_email_check()">
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<span class="text-info" id="contact_check_info"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -339,6 +342,23 @@ $(document).ready(function() {
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// Checks contact emails
|
||||
function contact_email_check() {
|
||||
var email = document.getElementById("contact_email").value;
|
||||
//Send a GET request to ajax.php as ajax.php?contact_email_check=true&email=email
|
||||
jQuery.get(
|
||||
"ajax.php",
|
||||
{contact_email_check: 'email', email: email},
|
||||
function(data) {
|
||||
//If we get a response from ajax.php, parse it as JSON
|
||||
const contact_check_data = JSON.parse(data);
|
||||
document.getElementById("contact_check_info").innerHTML = contact_check_data.message;
|
||||
}
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
||||
require_once '../../../includes/modal_footer.php';
|
||||
|
||||
Reference in New Issue
Block a user