JSFiddle - React, Tailwind, and code Playground
by hslincoln
HTML
<!-- Female button -->
<input type="image" name="usxtgender" id="usxtgender" value="1" src="/content/ebiz/shop/resources/images/spacer.gif" class="buttonSignUpGirl" />
<!-- Male button -->
<input type="image" name="usxtgender" id="usxtgender" value="2" src="/content/ebiz/shop/resources/images/spacer.gif" class="buttonSignUpBoy" />
JavaScript
var userEmail = Venda.Platform.getUrlParam(location.href, 'email');
var displyEmail = Venda.Platform.escapeHTML(userEmail);
var sesUsEmail = '';
var userType = '';
if ((sesUsEmail == userEmail) || (sesUsEmail == '')) {
document.emailsonly.usemail.value = userEmail;
document.getElementById("newsignup").innerHTML = 'Click <strong>Continue</strong> to sign up: <strong>' + displyEmail + '</strong>';
} else {
document.emailsonly.usemail.value = userEmail;
document.emailsonly.log.value = '4';
if (userType != 'G') {
document.getElementById("alreadysignup").innerHTML = 'You are already signed up as: <strong>' + sesUsEmail + '</strong>, only click <strong>Continue</strong> if you wish to sign up as: <strong>' + displyEmail + '</strong>';
} else {
document.getElementById("newsignup").innerHTML = 'Click <strong>Continue</strong> to sign up: <strong>' + displyEmail + '</strong>';
}
}
function checkMailsignup(Email, formElement, errorMsg) {
var userEmail = Venda.Platform.getUrlParam(location.href, 'email');
var emailStep = "Newsletter Signup";
var emailFlag = "Y";
if (checkemail(Email)) {
formElement.submit();
} else {
alert(errorMsg);
document.getElementById("reenteremail").innerHTML = 'Please enter a valid email address: <input type="text" name="reenter">';
return;
}
}
function checkReEnter(formElement, errorMsg) {
if (formElement.reenter == null) {
checkMailsignup(formElement.usemail.value, formElement, errorMsg);
return false;
} else {
formElement.usemail.value = document.emailsonly.reenter.value;
checkMailsignup(formElement.usemail.value, formElement, errorMsg);
return false;
}
}
var userEmail = Venda.Platform.getUrlParam(location.href, 'email');
var emailStep = "Newsletter Signup";
var emailFlag = "";
// female and male stuff
var emailFemale = Venda.Platform.getUrlParam(location.href, 'gender=1');
var emailMale =...