I have created a basic Smart Capture (name, first name, email address...) form in Cloud Pages. I also have the Subscriber Key as a hidden field. I would like it to be automatically populated with the same value as the one entered in Email Address.
I added the AMP Script %%Email Address%% to value in the code as below but it doesn't bring back any value.
<input name="Subscriber Key" type="hidden" value="%%Email Address%%"></form>
Is that the correct way to do? Or am I doing it wrong and how can I have the subscriber key automatically populated with the email?
Many thanks for your help.
A.P.
<table cellpadding="0" cellspacing="0" width="100%" class="stylingblock-content-wrapper" style="min-width: 100%; "><tr><td class="stylingblock-content-wrapper camarker-inner">
<form id="smartcapture-block-u7fm754onlb" class="smartcapture-content-wrapper fuelux" novalidate="novalidate">
<style id="smartcapture-styles-u7fm754onlb">
#smartcapture-block-u7fm754onlb {
background-color:#FFFFFF;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;text-align:left;margin:0px 0px 50px 50px;padding:10px;
}
#smartcapture-block-u7fm754onlb .smartcapture-controls {
padding-bottom: 10px;
}
#smartcapture-block-u7fm754onlb .smartcapture-controls .sc-formfield-label,
#smartcapture-block-u7fm754onlb .smartcapture-controls .sc-formfield-label label,
#smartcapture-block-u7fm754onlb .smartcapture-controls .sc-formfield-input label {
color:#000000;font-family:Arial, Helvetica, sans-serif;font-size:13px;
}
#smartcapture-block-u7fm754onlb input[type="radio"],
#smartcapture-block-u7fm754onlb input[type="checkbox"] {
margin: 0 0.4em 3px 0;
vertical-align: middle;
}
#smartcapture-block-u7fm754onlb input[type="text"],
#smartcapture-block-u7fm754onlb input[type="email"],
#smartcapture-block-u7fm754onlb input[type="number"] {
width:200px;
}
#smartcapture-block-u7fm754onlb .sc-button {
background-color:#000000;border-color:#000000;border-radius:3px;border-style:solid;-webkit-border-radius:3px;-moz-border-radius:3px;color:#FFFFFF;font-family:Arial, Helvetica, sans-serif;font-size:14px;line-height:normal;padding:10px;
}
#smartcapture-block-u7fm754onlb .smartcapture-submit-button-wrapper {
padding-bottom:10px;text-align:left;
}
#smartcapture-block-u7fm754onlb .date-dropdown-select-boxes input {
display: none;
}
#smartcapture-block-u7fm754onlb .date-dropdown-select-boxes .select {
max-height: 28em;
max-width: 6em;
overflow: auto;
}
</style>
<div data-type="slot" data-key="98lxuqif8ts"></div>
<div class="smartcapture-submit-button-wrapper">
<button type="submit" class="sc-button">SUBMIT</button>
</div>
<script id="smartcapture-script-u7fm754onlb">
var scFormLoaded = function () {
window.ScForm.init({"gearID":"u7fm754onlb","smartCaptureFormID":298,"sourceKey":"48C16CC9-5B6A-4C84-B669-8E1959DB2ED5","source":"dataExtension","triggeredSend":"","confirmationMessage":"<div style=\"text-align: center;\">\n\t<br />\n\t<br />\n\t<span style=\"color:#000000;\"><span style=\"font-size:20px;\"><b><span style=\"font-family:arial,helvetica,sans-serif;\">THANK YOU FOR YOUR NOMINATION!</span></b></span></span><br />\n\t<br />\n\t </div>","buttonText":"SUBMIT","formStyling":{"background-color":"#FFFFFF","margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px","padding-top":"0px","padding-right":"0px","padding-bottom":"0px","padding-left":"0px","text-align":"left","margin":"0px 0px 50px 50px","padding":"10px"},"fieldStyling":{"width":"200px"},"buttonStyling":{"background-color":"#000000","border-color":"#000000","border-radius":"3px","border-style":"solid","-webkit-border-radius":"3px","-moz-border-radius":"3px","color":"#FFFFFF","font-family":"Arial, Helvetica, sans-serif","font-size":"14px","line-height":"normal","padding":"10px"},"onSubmitGotoUrlType":2,"onSubmitGotoUrl":"https://www.pinkshirtmaker.com"});
};
window.appDomain = window.appDomain || '<ctrl:eval>Platform.Variable.GetValue("@appDomain")||""</ctrl:eval>';
window.contentDetail = window.contentDetail || <ctrl:eval>Platform.Variable.GetValue('@contentDetail')||{}</ctrl:eval>;
if (!window.ScForm || !window.ScForm.init) {
var head = document.getElementsByTagName('head')[0];
var id = 'smartcapture-formjs-script';
var script = document.getElementById(id);
var domain = window.appDomain;
var el;
if (!script) {
if (domain) {
domain = '//' + domain;
}
el = document.createElement('script');
el.async = true;
el.id = id;
el.src = domain + '/CloudPages/lib/smartcapture-formjs.js';
el.onload = scFormLoaded;
head.appendChild(el);
} else {
if (script.addEventListener) {
script.addEventListener('load', scFormLoaded);
} else if (script.attachEvent) {
script.attachEvent('onload', scFormLoaded);
}
}
} else {
scFormLoaded();
}
</script>
<input name="Phone Number" type="hidden" value=""><input name="Subscriber Key" type="hidden" value="%%Email Address 2%%"></form>
</td></tr></table>