Auf Seite 7 erscheint der folgende Code:
question('YZ01','1,2'); // email, subject_id
html('
<div class="uk-alert-primary" uk-alert>
<div class="uk-grid-small uk-flex-middle" uk-grid>
<div class="uk-width-auto">
<span uk-icon="icon: lock; ratio: 2"></span>
</div>
<div class="uk-width-expand">
<p class="uk-text-large uk-margin-remove-bottom">Optimaler Datenschutz dank Teilnahmecode</p>
<p class="uk-margin-remove-top ">Aus deiner E-Mail-Adresse generieren wir einen für dich individualisierten Teilnahmecode. Nach Eingabe wird dir dein persönlicher Code angezeigt, woraufhin deine E-Mail-Adresse aus dem System sofort gelöscht wird. Hierdurch vermeiden wir es, deine personenbezogenen
Daten zu speichern.</p>
</div>
</div>
</div>
<div class="uk-form-stacked uk-margin">
<div class="uk-margin">
<div class="uk-inline uk-width-1-1">
<span class="uk-form-icon" uk-icon="icon: mail"></span>
<input id="email" class="uk-input" type="text" placeholder="Ihre E-Mail-Adresse" />
</div>
</div>
<div class="uk-margin">
<label class="uk-form-label uk-text-bold">Generierter Teilnahmecode</label>
<div class="uk-inline uk-width-1-1">
<span class="uk-form-icon" uk-icon="icon: hashtag"></span>
<input id="subject_id" class="uk-input" type="text" disabled="disabled" />
</div>
</div>
</div>
');
html('
<script>
let sss_hidden_email = "#YZ01_01";
let sss_hidden_subject_id = "#YZ01_02";
let email_input = "#email";
let subject_id_input = "#subject_id";
$(document).ready(function() {
$("#submit0").hide();
});
$(email_input).on("input", function() {
let regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9])+$/;
let email_str = $(email_input).val().toLowerCase();
if (regex.test(email_str)) {
email_str_cut = email_str.substring(0, email_str.length - 5);
$(subject_id_input).val($.MD5(email_str_cut));
$(sss_hidden_email).val(email_str);
$(sss_hidden_subject_id).val($(subject_id_input).val());
UIkit.notification.closeAll();
UIkit.notification({
message: "<div class=\"uk-text-small\"><span uk-icon=\"icon: check\"></span> Sie können zur nächsten Seite fortfahren!</div>",
status: "success",
pos: "bottom-center",
timeout: 5000
});
$(email_input).addClass("uk-form-success");
$(email_input).removeClass("uk-form-danger");
$("#submit0").show();
} else {
$(sss_hidden_email).val("");
$(sss_hidden_subject_id).val("");
UIkit.notification.closeAll();
UIkit.notification({
message: "<div class=\"uk-text-small\"><span uk-icon=\"icon: ban\"></span> Ungültige E-Mail-Adresse! </div>",
status: "danger",
pos: "bottom-center",
timeout: 5000
});
$(email_input).addClass("uk-form-danger");
$(email_input).removeClass("uk-form-success");
$("#submit0").hide();
}
});
</script>
');