JSFiddle - React, Tailwind, and code Playground
HTML
<!-- BEGIN EMAIL VERIFICATION FORM -->
<div id="verifyMessage"></div>
<div id="verify-email-container">
<form name="verify_email" id="verify_email">
<input type="hidden" name="code" id="code" value="<?php echo $parts['code']; ?>">
<input type="hidden" name="user" id="user" value="<?php echo $parts['user']; ?>">
<input type="hidden" name="extra" id="extra" value="<?php echo $parts['extra']; ?>">
</form>
</div>
<!-- END EMAIL VERIFICATION FORM -->
CSS
#verifybutton {
margin-top: 0px;
background: #61bd2b;
border-top: 1px solid #529d26;
border-right: 1px solid #2c5615;
border-bottom: 1px solid #1d390e;
border-left: 1px solid #2c5615;
border-radius: 4px;
box-shadow: inset 0 1px 10px 1px #8eff4b,
0px 1px 0 #2c5713,
0 6px 0px #305e14,
0 8px 4px 1px #111111;
color: #fff;
font: bold 20px/1 "helvetica neue",
helvetica,
arial,
sans-serif;
margin-bottom: 15px;
padding: 10px 0 12px 0;
text-align: center;
text-shadow: 0px -1px 1px #1e2d4d;
width: 150px;
-webkit-background-clip: padding-box;
float:right;
}
#verifybutton:hover {
box-shadow: inset 0 0px 20px 1px #bdff87,
0px 1px 0 #324d1d,
0 6px 0px #37531f,
0 8px 4px 1px #111111;
cursor: pointer;
}
#verifybutton:active {
box-shadow: inset 0 1px 10px 1px #a5df76,
0 1px 0 #203213,
0 2px 0 #223413,
0 4px 3px 0 #111111;
margin-top: 5px;
margin-bottom: 10px;
}
#verify-email-container {
text-align: center;
width: 100%;
margin: 0px auto;
}
#verify_email {
width: 150px;
text-align: center;
margin: 0px auto;
}
JavaScript
// BEGIN EMAIL VERIFICATION FUNCTION
$(document).ready(function() {
alert('Ok!');
var user = $('#user').val();
var code = $('#code').val();
var extra = $('#extra').val();
// show our holding text in the validation message space
verifyM = '<img src="http://btcmutual.com/assets/gif/ajax-loader.gif" height="16" width="16"> ' +
'Attempting to activate your account...';
$('#verifyMessage').html(verifyM);
$.ajax({
url: 'http://btcmutual.com/engine/includes/functions.php',
data: 'verify=true&user=' + user + '&code=' + code + '&extra=' + extra,
dataType: 'json',
type: 'post',
success: function (j) {
if (j.ok) {
vmsg = 'Hello, ' + j.ma + ' | ' + j.lo;
$('#userTitle').html(vmsg);
$('#verifyMessage').html(j.msg);
} else {
$('#verifyMessage').html(j.msg);
}
}
});
});
// END EMAIL VERIFICATION FUNCTION