Indlæser
Fejlmeddelelse
Der skete en fejl under lagringen. Gennemgå venligst formularen og prøv igen.
$VAR1 = "<script type=\"text/javascript\" src=\"/includes/AIR_ibutik_Arbetsyta.js?1311112\"></script>
<section id=\"mypages-container\">
<form action=\"/RegistreraNyKund.php\" method=\"post\" name=\"BestForm\" >
<input type=\"hidden\" name=\"funk\" value=\"kund_ny_slutfor\">
<input type=\"hidden\" name=\"nastasteg\" value=\"ny\">
<span class=\"KundNyText\">
<h1 class=\"Dinsida_Topprubrik\">Opret ny kundeprofil</h1>
</span>
<span class=\"KundNyText\">
Oplysninger m\x{e6}rket med * er obligatoriske.<br><br>
</span>
<div id=\"Adressblock\" >
<p class=\"LankLoggain\">
<label class=\"Snabbkassa_Kunduppgift_Etiketter LankLoggaInSpan\"> </label>
<a href=\"javascript:ShowHide('AdressblockLoggain');ShowHide('Adressblock');\">
<i>Jeg har en konto og vil logge ind »</i>
</a>
</p>
<div id=\"Adressblock2\" >
<fieldset class=\"customerprofile-fieldset\" >
<legend>
Kundoplysninger<span class=\"colon\">:</span>
</legend>
<!-- default -->
<div
class=\"wrap-field customerprofile-field required \"
id=\"SKM_PNr\"
>
<label
for=\"PNr\"
>
<span class=\"title\">
CPR-nr./CVR-nr.:
</span>
<span class=\"required-icon\"><i class=\"far fa-star\" aria-label=\"Stjerne\" aria-hidden=\"true\"></i></span>
</label>
<input
type=\"text\"
aria-invalid=\"false\"
aria-errormessage=\"error_text_PNr\"
id=\"PNr\"
name=\"Pnr\"
size=\"15\"
class=\"KundprofilFaltOK_Kort\"
maxlength=\"15\"
required aria-required=\"true\"
>
<div id=\"error_text_PNr\" class=\"error_text\">
<span class=\"error-icon\"><i class=\"fas fa-exclamation-circle\" aria-hidden=\"true\"></i></span>
<span class=\"error-message\">Fejlmeddelelse: </span>
</div>
</div>
<p style=\"display:none;visibility:hidden;margin:0;padding:0\" id=\"LankKassanAngeAdress\"></p>
<p style=\"display:none;visibility:hidden;margin:0;padding:0\" id=\"LankKassanLogin\"></p>
<p style=\"display:none;visibility:hidden;margin:0;padding:0\" id=\"KreditorInfo\"></p>
<p style=\"display:none;visibility:hidden;margin:0;padding:5;background-color:#EEEEEE;width:100%\" id=\"KreditorArsinkomst\"></p>
<div
class=\"wrap-field customerprofile-field \"
id=\"SKM_Foretag\" style=\"display:none;visibility:hidden;margin:0;padding:0\"
>
<label
for=\"Foretag\"
>
<span class=\"title\">
Firmanavn:
</span>
</label>
<input
type=\"text\"
aria-invalid=\"false\"
aria-errormessage=\"error_text_Foretag\"
id=\"Foretag\"
name=\"Foretag\"
size=\"25\"
class=\"KundprofilFaltOK\"
maxlength=\"50\"
>
<div id=\"error_text_Foretag\" class=\"error_text\">
<span class=\"error-icon\"><i class=\"fas fa-exclamation-circle\" aria-hidden=\"true\"></i></span>
<span class=\"error-message\">Fejlmeddelelse: </span>
</div>
</div>
<div
class=\"wrap-field customerprofile-field required \"
id=\"SKM_Fornamn\"
>
<label
for=\"Fornamn\"
>
<span class=\"title\">
Fornavn:
</span>
<span class=\"required-icon\"><i class=\"far fa-star\" aria-label=\"Stjerne\" aria-hidden=\"true\"></i></span>
</label>
<input
type=\"text\"
aria-invalid=\"false\"
aria-errormessage=\"error_text_Fornamn\"
id=\"Fornamn\"
name=\"Fornamn\"
size=\"25\"
class=\"KundprofilFaltOK\"
maxlength=\"50\"
required aria-required=\"true\"
>
<div id=\"error_text_Fornamn\" class=\"error_text\">
<span class=\"error-icon\"><i class=\"fas fa-exclamation-circle\" aria-hidden=\"true\"></i></span>
<span class=\"error-message\">Fejlmeddelelse: </span>
</div>
</div>
<div
class=\"wrap-field customerprofile-field required \"
id=\"SKM_Efternamn\"
>
<label
for=\"Efternamn\"
>
<span class=\"title\">
Efternavn:
</span>
<span class=\"required-icon\"><i class=\"far fa-star\" aria-label=\"Stjerne\" aria-hidden=\"true\"></i></span>
</label>
<input
type=\"text\"
aria-invalid=\"false\"
aria-errormessage=\"error_text_Efternamn\"
id=\"Efternamn\"
name=\"Efternamn\"
size=\"25\"
class=\"KundprofilFaltOK\"
maxlength=\"50\"
required aria-required=\"true\"
>
<div id=\"error_text_Efternamn\" class=\"error_text\">
<span class=\"error-icon\"><i class=\"fas fa-exclamation-circle\" aria-hidden=\"true\"></i></span>
<span class=\"error-message\">Fejlmeddelelse: </span>
</div>
</div>
</fieldset>
<fieldset class=\"customerprofile-fieldset\" id=\"linkAdressBlockAnvnamn\">
<legend>
Brugernavn og adgangskode<span class=\"colon\">:</span>
</legend>
<div
class=\"wrap-field customerprofile-field required \"
id=\"SKM_Anvnamn\"
>
<label
for=\"Anvnamn\"
>
<span class=\"title\">
Brugernavn:
</span>
<span class=\"required-icon\"><i class=\"far fa-star\" aria-label=\"Stjerne\" aria-hidden=\"true\"></i></span>
</label>
<input
type=\"text\"
aria-invalid=\"false\"
aria-errormessage=\"error_text_Anvnamn\"
id=\"Anvnamn\"
name=\"Anvnamn\"
size=\"25\"
class=\"KundprofilFaltOK\"
required aria-required=\"true\"
>
<div id=\"error_text_Anvnamn\" class=\"error_text\">
<span class=\"error-icon\"><i class=\"fas fa-exclamation-circle\" aria-hidden=\"true\"></i></span>
<span class=\"error-message\">Fejlmeddelelse: </span>
</div>
</div>
<div
class=\"wrap-field customerprofile-field required \"
id=\"SKM_Losenord\"
>
<label
for=\"Losenord\"
>
<span class=\"title\">
Adgangskode:
</span>
<span class=\"required-icon\"><i class=\"far fa-star\" aria-label=\"Stjerne\" aria-hidden=\"true\"></i></span>
</label>
<input
type=\"password\"
aria-invalid=\"false\"
aria-errormessage=\"error_text_Losenord\"
id=\"Losenord\"
name=\"Losenord\"
size=\"25\"
class=\"KundprofilFaltOK\"
required aria-required=\"true\"
>
<div id=\"error_text_Losenord\" class=\"error_text\">
<span class=\"error-icon\"><i class=\"fas fa-exclamation-circle\" aria-hidden=\"true\"></i></span>
<span class=\"error-message\">Fejlmeddelelse: </span>
</div>
</div>
<div
class=\"wrap-field customerprofile-field required \"
id=\"SKM_Losenord_Repeterat\"
>
<label
for=\"Losenord_Repeterat\"
>
<span class=\"title\">
Gentag adgangskoden:
</span>
<span class=\"required-icon\"><i class=\"far fa-star\" aria-label=\"Stjerne\" aria-hidden=\"true\"></i></span>
</label>
<input
type=\"password\"
aria-invalid=\"false\"
aria-errormessage=\"error_text_Losenord_Repeterat\"
id=\"Losenord_Repeterat\"
name=\"Losenord_Repeterat\"
size=\"25\"
class=\"KundprofilFaltOK\"
required aria-required=\"true\"
>
<div id=\"error_text_Losenord_Repeterat\" class=\"error_text\">
<span class=\"error-icon\"><i class=\"fas fa-exclamation-circle\" aria-hidden=\"true\"></i></span>
<span class=\"error-message\">Fejlmeddelelse: </span>
</div>
</div>
</fieldset>
<fieldset class=\"customerprofile-fieldset\" id=\"linkAdressBlockLeveransadress\">
<legend>
Leveringsadresse<span class=\"colon\">:</span>
</legend>
<div
class=\"wrap-field customerprofile-field required \"
id=\"SKM_Adress\"
>
<label
for=\"Adress\"
>
<span class=\"title\">
Leveringsadresse:
</span>
<span class=\"required-icon\"><i class=\"far fa-star\" aria-label=\"Stjerne\" aria-hidden=\"true\"></i></span>
</label>
<input
type=\"text\"
aria-invalid=\"false\"
aria-errormessage=\"error_text_Adress\"
id=\"Adress\"
name=\"Adress\"
size=\"25\"
class=\"KundprofilFaltOK\"
required aria-required=\"true\"
>
<div id=\"error_text_Adress\" class=\"error_text\">
<span class=\"error-icon\"><i class=\"fas fa-exclamation-circle\" aria-hidden=\"true\"></i></span>
<span class=\"error-message\">Fejlmeddelelse: </span>
</div>
</div>
<div
class=\"wrap-field customerprofile-field required \"
id=\"SKM_Postnr\"
>
<label
for=\"Postnr\"
>
<span class=\"title\">
Postnr.:
</span>
<span class=\"required-icon\"><i class=\"far fa-star\" aria-label=\"Stjerne\" aria-hidden=\"true\"></i></span>
</label>
<input
type=\"text\"
aria-invalid=\"false\"
aria-errormessage=\"error_text_Postnr\"
id=\"Postnr\"
name=\"Postnr\"
size=\"25\"
class=\"KundprofilFaltOK\"
required aria-required=\"true\"
>
<div id=\"error_text_Postnr\" class=\"error_text\">
<span class=\"error-icon\"><i class=\"fas fa-exclamation-circle\" aria-hidden=\"true\"></i></span>
<span class=\"error-message\">Fejlmeddelelse: </span>
</div>
</div>
<div id=\"LaddaOmPostnr\" style=\"display:none;margin:0;margin-top:10px;margin-bottom:10px;padding:10px;background-color:#EEEEEE;width:100%;text-align:center;vertical-align:middle;\"><img src=\"/bilder/ibutik-a/loading.gif\"><br><br><i>Loading shipping options...</i></div>
<div
class=\"wrap-field customerprofile-field required \"
id=\"SKM_Ort\"
>
<label
for=\"Ort\"
>
<span class=\"title\">
By:
</span>
<span class=\"required-icon\"><i class=\"far fa-star\" aria-label=\"Stjerne\" aria-hidden=\"true\"></i></span>
</label>
<input
type=\"text\"
aria-invalid=\"false\"
aria-errormessage=\"error_text_Ort\"
id=\"Ort\"
name=\"Ort\"
size=\"25\"
class=\"KundprofilFaltOK\"
required aria-required=\"true\"
>
<div id=\"error_text_Ort\" class=\"error_text\">
<span class=\"error-icon\"><i class=\"fas fa-exclamation-circle\" aria-hidden=\"true\"></i></span>
<span class=\"error-message\">Fejlmeddelelse: </span>
</div>
</div>
<div
class=\"wrap-field customerprofile-field required \"
id=\"SKM_Land\"
>
<label
for=\"Land\"
>
<span class=\"title\">
Land:
</span>
<span class=\"required-icon\"><i class=\"far fa-star\" aria-label=\"Stjerne\" aria-hidden=\"true\"></i></span>
</label>
<div class=\"select-wrapper\">
<select
id=\"Land\"
name=\"Land\"
class=\"KundprofilFaltOK\"
required aria-required=\"true\"
aria-invalid=\"false\"
aria-errormessage=\"error_text_Land\"
>
<option value=\"\"></option> <option value=\"Denmark\" rel=\";;\" selected>Denmark</option>
</select>
</select>
</div>
<div id=\"error_text_Land\" class=\"error_text\">
<span class=\"error-icon\"><i class=\"fas fa-exclamation-circle\" aria-hidden=\"true\"></i></span>
<span class=\"error-message\">Fejlmeddelelse: </span>
</div>
</div>
<div id=\"LaddaOmLand\" style=\"display:none;margin:0;margin-top:10px;margin-bottom:10px;padding:10px;background-color:#EEEEEE;width:100%;text-align:center;vertical-align:middle;\"><img src=\"/bilder/ibutik-a/loading.gif\"><br><br><i>Loading shipping options...</i></div>
</fieldset>
<input type=\"hidden\" name=\"Adress2\" value=\"\">
<input type=\"hidden\" name=\"Adress2_Extra\" value=\"\">
<input type=\"hidden\" name=\"Adress2_Extra2\" value=\"\">
<input type=\"hidden\" name=\"Teldag2\" value=\"\">
<input type=\"hidden\" name=\"Fornamn2\" value=\"\">
<input type=\"hidden\" name=\"Efternamn2\" value=\"\">
<input type=\"hidden\" name=\"Postnr2\" value=\"\">
<input type=\"hidden\" name=\"Ort2\" value=\"\">
<input type=\"hidden\" name=\"Stat2\" value=\"\">
<input type=\"hidden\" name=\"Land2\" value=\"\">
<input type=\"hidden\" name=\"Foretag2\" value=\"\">
<input type=\"hidden\" name=\"Epost2\" value=\"\">
<input type=\"hidden\" name=\"Pnr2\" value=\"\">
<input type=\"hidden\" name=\"Adress2_Husnummer\" value=\"\">
<input type=\"hidden\" name=\"Adress2_Houseextension\" value=\"\">
<fieldset class=\"customerprofile-fieldset\" id=\"linkAdressBlockOvrigt\">
<legend>
\x{d8}vrige oplysninger<span class=\"colon\">:</span>
</legend>
<div
class=\"wrap-field customerprofile-field required \"
id=\"SKM_Epost\"
>
<label
for=\"Epost\"
>
<span class=\"title\">
E-mail-adresse:
</span>
<span class=\"required-icon\"><i class=\"far fa-star\" aria-label=\"Stjerne\" aria-hidden=\"true\"></i></span>
</label>
<input
type=\"text\"
aria-invalid=\"false\"
aria-errormessage=\"error_text_Epost\"
id=\"Epost\"
name=\"Epost\"
size=\"25\"
class=\"KundprofilFaltOK\"
required aria-required=\"true\"
>
<div id=\"error_text_Epost\" class=\"error_text\">
<span class=\"error-icon\"><i class=\"fas fa-exclamation-circle\" aria-hidden=\"true\"></i></span>
<span class=\"error-message\">Fejlmeddelelse: </span>
</div>
</div>
<div
class=\"wrap-field customerprofile-field \"
id=\"SKM_Teldag\"
>
<label
for=\"Teldag\"
>
<span class=\"title\">
Telefon:
</span>
</label>
<input
type=\"text\"
aria-invalid=\"false\"
aria-errormessage=\"error_text_Teldag\"
id=\"Teldag\"
name=\"Teldag\"
size=\"25\"
class=\"KundprofilFaltOK\"
>
<div id=\"error_text_Teldag\" class=\"error_text\">
<span class=\"error-icon\"><i class=\"fas fa-exclamation-circle\" aria-hidden=\"true\"></i></span>
<span class=\"error-message\">Fejlmeddelelse: </span>
</div>
</div>
</fieldset>
<p class=\"Snabbkassa_Kundfalt_Marginal BestFormSendBtn_wrap\" >
<button class=\"btn-auto btn-md\" type=\"button\" onclick=\"_regValidation(this);\" id=\"BestFormSendBtn\">
Gem
</a>
</button>
</p>
</div>
</div>
<div id=\"AdressblockPaminnare\" style=\"display:none;visibility:hidden\">
E-mail-adresse eller kundenummer:
<input type=\"text\" name=\"EpostPaminnelse\" size=\"20\" >
<button type=\"button\" onclick=\"AIR_Paminnare();\" >
Send oplysningerne nu »
</button>
<a href=\"javascript:ShowHide('AdressblockPaminnare');ShowHide('Adressblock');\">
Jeg vil angive nye adresseoplysninger »
</a>
</div>
</form>
<div id=\"dialogruta\">
<div id=\"Felmeddelande\">
</div>
</div>
<br>
<div class=\"status_message status_message-negative BestFormErrormessage hide\" role=\"alert\" data-errorcode=\"BestFormError\">
<div class=\"box\">
<i class=\"fas fa-exclamation-circle text-xl\" aria-hidden=\"true\"></i>
<span class=\"font-xl text-uppercase\">Fejlmeddelelse</span>
<div class=\"status_message__main\">Der skete en fejl under lagringen. Gennemg\x{e5} venligst formularen og pr\x{f8}v igen.</div>
<button type=\"button\" class=\"btn-auto btn-sm \" onclick=\"AIR_close_message(this)\" tabindex=\"0\">OK</button>
</div>
</div>
<script>
var AIR_close_message = function(button) {
button.closest('.status_message').classList.add('hide');
};
</script>
<br>
<form method=\"get\" action=\"/cgi-bin/ibutik/BC_HamtaInformation.pl\" name=\"FormHamtaAdressBC\" style=\"margin:0;padding:0\">
<input type=\"hidden\" name=\"CheckPoint\" value=\"FormHamtaAdressBC\">
<input type=\"hidden\" name=\"Pno1\" value=\"\">
<input type=\"hidden\" name=\"Typ\" value=\"Adress\">
<input type=\"hidden\" name=\"Ajax\" value=\"N\">
<input type=\"hidden\" name=\"Privat_Foretag\" value=\"\">
<input type=\"hidden\" name=\"AnropTyp\" value=\"KundNy\">
<input type=\"hidden\" name=\"ref\" value=\"\">
<input type=\"hidden\" name=\"Presentkort\" value=\"\">
<input type=\"hidden\" name=\"GodkannaVillkor\" value=\"\">
</form><script language=\"JavaScript\">
<!--
function AIR_HamtaAdressBC(pnrId)
{
var pnrObj = ''
if (document.BestForm.Pnr)
{
pnrObj = document.BestForm.Pnr
}
if (pnrObj === '')
{
pnrObj = document.getElementById(pnrId)
}
if(typeof ValideraPnrBC == 'function') {
var pnr = pnrObj.value
var retValue = ''
var msg = ValideraPnrBC(pnr);
if (msg != '')
{
retValue += msg + \"<br>\";
pnrObj.className='KundprofilFaltFEL_Kort';
}
else
{
pnrObj.className='KundprofilFaltOK_Kort';
}
}
else
{
pnrObj.className='KundprofilFaltOK_Kort';
}
if (typeof ValideraPnrBC == 'function' && retValue != '')
{
var dialogText = '<br><h1><img src=\"/bilder/ibutik-a/symboler/varning.gif\" align=\"absmiddle\"> Der er opst\x{e5}et f\x{f8}lgende fejl:</h1><br><b>'+retValue;
dialogText += '<br><br><a href=\\'#\\' onclick=\\'visa_dialogruta()\\'>Luk »</a>';
visa_dialogruta(dialogText);
return;
}
if ((document.FormHamtaAdressBC.GodkannaVillkor != undefined) && (document.getElementById('GodkannaVillkorCB') != undefined))
{
if (document.getElementById('GodkannaVillkorCB').checked == true)
{
document.FormHamtaAdressBC.GodkannaVillkor.value = document.getElementById('GodkannaVillkorCB').value;
}
}
var personnummer = pnrObj.value;
if (personnummer === '')
{
pnrObj = document.getElementById(pnrId);
}
document.FormHamtaAdressBC.Pno1.value = personnummer;
document.FormHamtaAdressBC.submit();
}
//-->
</script>
<form method=\"post\" action=\"/cgi-bin/ibutik/AIR_ibutik.fcgi\" name=\"LoggaIn\" style=\"margin:0;padding:0\">
<input type=\"hidden\" name=\"CheckPoint\" value=\"LoggaIn\">
<input type=\"hidden\" name=\"Anvnamn\" value=\"\">
<input type=\"hidden\" name=\"Losenord\" value=\"\">
<input type=\"hidden\" name=\"Betalning_ID\" value=\"\">
<input type=\"hidden\" name=\"Frakt_ID\" value=\"\">
<input type=\"hidden\" name=\"Avisering_ID\" value=\"\">
<input type=\"hidden\" name=\"funk\" value=\"kundprofil_inloggning_slutfor\">
<input type=\"hidden\" name=\"ref\" value=\"\">
<input type=\"hidden\" name=\"Presentkort\" value=\"\">
<input type=\"hidden\" name=\"GodkannaVillkor\" value=\"\">
</form><script language=\"JavaScript\">
<!--
function AIR_LoggaIn()
{
if ((document.LoggaIn.GodkannaVillkor != undefined) && (document.getElementById('GodkannaVillkorCB') != undefined))
{
if (document.getElementById('GodkannaVillkorCB').checked == true)
{
document.LoggaIn.GodkannaVillkor.value = document.getElementById('GodkannaVillkorCB').value;
}
}
if (document.BestForm.Betalning_ID != undefined)
{
if (eval(\"document.BestForm.Betalning_ID.checked\") == true)
{
document.LoggaIn.Betalning_ID.value = document.BestForm.Betalning_ID.value;
}
else
{
for (var i=0;i<document.BestForm.Betalning_ID.length;i++)
{
if (eval(\"document.BestForm.Betalning_ID[i].checked\") == true)
{
document.LoggaIn.Betalning_ID.value = document.BestForm.Betalning_ID[i].value;
}
}
}
}
if (document.BestForm.Frakt_ID != undefined)
{
if (eval(\"document.BestForm.Frakt_ID.checked\") == true)
{
document.LoggaIn.Frakt_ID.value = document.BestForm.Frakt_ID.value;
}
else
{
for (var i=0;i<document.BestForm.Frakt_ID.length;i++)
{
if (eval(\"document.BestForm.Frakt_ID[i].checked\") == true)
{
document.LoggaIn.Frakt_ID.value = document.BestForm.Frakt_ID[i].value;
}
}
}
}
if (document.BestForm.Avisering_ID != undefined)
{
if (eval(\"document.BestForm.Avisering_ID.checked\") == true)
{
document.LoggaIn.Avisering_ID.value = document.BestForm.Avisering_ID.value;
}
else
{
for (var i=0;i<document.BestForm.Avisering_ID.length;i++)
{
if (eval(\"document.BestForm.Avisering_ID[i].checked\") == true)
{
document.LoggaIn.Avisering_ID.value = document.BestForm.Avisering_ID[i].value;
}
}
}
}
document.LoggaIn.Anvnamn.value = document.BestForm.Loggain_Anvnamn.value;
document.LoggaIn.Losenord.value = document.BestForm.Loggain_Losenord.value;
if (typeof(checkout_login_ajax) == \"function\") {
checkout_login_ajax();
} else {
document.LoggaIn.submit();
}
}
//-->
</script>
<form method=\"post\" action=\"/cgi-bin/ibutik/AIR_ibutik.fcgi\" name=\"Paminnare\" style=\"margin:0;padding:0\">
<input type=\"hidden\" name=\"CheckPoint\" value=\"Paminnare\">
<input type=\"hidden\" name=\"Epost\" value=\"\">
<input type=\"hidden\" name=\"funk\" value=\"kund_skickapw_slutfor\">
<input type=\"hidden\" name=\"nastasteg\" value=\"\">
<input type=\"hidden\" name=\"ref\" value=\"\">
<input type=\"hidden\" name=\"Presentkort\" value=\"\">
<input type=\"hidden\" name=\"GodkannaVillkor\" value=\"\">
</form><script language=\"JavaScript\">
<!--
function AIR_Paminnare()
{
if ((document.Paminnare.GodkannaVillkor != undefined) && (document.getElementById('GodkannaVillkorCB') != undefined))
{
if (document.getElementById('GodkannaVillkorCB').checked == true)
{
document.Paminnare.GodkannaVillkor.value = document.getElementById('GodkannaVillkorCB').value;
}
}
document.Paminnare.Epost.value = document.BestForm.EpostPaminnelse.value;
document.Paminnare.nastasteg.value = document.BestForm.nastasteg.value;
document.Paminnare.submit();
}
//-->
</script>
<script language=\"JavaScript\">
<!--
var epost_korrekt = /^([A-Za-z0-9\\.\\_\\%\\+\\-])+\\\@([A-Za-z0-9\\-\\.])+\\.([A-Za-z]{2,})\$/;
var pnrextra_korrekt = /\\d{4}/;
var felaktigatecken = /([<>\"|;\\[\\]{}()])/;
function AIR_FaltKoll() {
if (document.getElementsByName(\"AIR-EverythingInItsRightPlace\")[0] === undefined)
{
var hidden_input = document.createElement(\"input\");
hidden_input.setAttribute(\"type\", \"hidden\");
hidden_input.setAttribute(\"name\", \"AIR-EverythingInItsRightPlace\");
hidden_input.setAttribute(\"value\", \"AIR\");
document.forms['BestForm'].appendChild(hidden_input);
}
if(typeof valideraFormular == 'function')
{
var returVarde = valideraFormular();
if (returVarde == false)
{
return;
}
}
if(typeof AIR_filtreraTextfalt == 'function'){AIR_filtreraTextfalt('BestForm');} var Returmeddelande = '';
var ingafaltfinns = ''
var invalid_inputs = document.BestForm.querySelectorAll(':invalid');
for (var i = 0; i < invalid_inputs.length; i++) {
if (invalid_inputs[i].dataset.component == 'contract')
{
Returmeddelande += \"• Du ikke har godkendt \" + invalid_inputs[i].dataset.label + \"<br>\";
}
} if(typeof ValideraAnpassadeFalt == 'function') { Returmeddelande += ValideraAnpassadeFalt();} if(typeof valideraDirektinlosen == 'function')
{
Returmeddelande += valideraDirektinlosen();
if (Returmeddelande != '')
{
jQuery('#presentkort_direktinlosen').attr(\"class\",\"KundprofilFaltFEL_Kort\");
}
else
{
jQuery('#presentkort_direktinlosen').attr(\"class\",\"KundprofilFaltOK_Kort\");
}
}
if(typeof valideraAlder == 'function')
{
Returmeddelande += valideraAlder();
if (Returmeddelande != '')
{
jQuery('#Pnr').attr(\"class\",\"KundprofilFaltFEL_Kort\");
}
else
{
jQuery('#Pnr').attr(\"class\",\"KundprofilFaltOK_Kort\");
}
}
var losenord_korrekt = /\\S{6}/;
pnr = document.BestForm.Pnr.value;
pnr_min = 7;
pnr_max = 16;
pnr_match = \"[0-9A-Za-z]\";
if(document.BestForm.Land !== undefined && document.BestForm.Land.selectedIndex !== undefined) {
landInfo = document.BestForm.Land.value;
opt_index = document.BestForm.Land.selectedIndex;
if(landInfo = document.BestForm.Land[opt_index].getAttribute('rel')) {
landInfoSplit = landInfo.split(\";\");
if((landInfoSplit[0] !== undefined && landInfoSplit[0] !== '') && (landInfoSplit[1] !== undefined && landInfoSplit[1] !== '') && (landInfoSplit[2] !== undefined && landInfoSplit[2] !== ''))
{
pnr_min = landInfoSplit[0];
pnr_max = landInfoSplit[1];
pnr_match = landInfoSplit[2];
}
else if(landInfoSplit[0] == '' && landInfoSplit[1] == '' && landInfoSplit[2] == '')
{
pnr_min = 7;
pnr_max = 16;
pnr_match = \"[0-9A-Za-z]\";
}
}
}
regExpText = pnr_match;if(pnr.length > 0) {
regExpText = regExpText + \"{\" + pnr.length + \"}\";
}
var pnr_korrekt = new RegExp(regExpText);
if(document.BestForm.Losenord_Repeterat)
{
if(!(losenord_korrekt.test(document.BestForm.Losenord.value)))
{
Returmeddelande += '• Adgangskoden er for kort (mindst 6 tegn) <br>';
document.BestForm.Losenord.className='KundprofilFaltFEL';
}
else if (document.BestForm.Losenord.value != document.BestForm.Losenord_Repeterat.value)
{
Returmeddelande += '• Adgangskoderne matcher ikke <br>';
document.BestForm.Losenord.className='KundprofilFaltFEL';
document.BestForm.Losenord_Repeterat.className='KundprofilFaltFEL';
}
else
{
document.BestForm.Losenord.className='KundprofilFaltOK';
document.BestForm.Losenord_Repeterat.className='KundprofilFaltOK';
}
}
if (document.BestForm.Anvnamn.value == '')
{
Returmeddelande += '• Du har ikke angivet et brugernavn <br>';
document.BestForm.Anvnamn.className='KundprofilFaltFEL';
}
else
{
document.BestForm.Anvnamn.className='KundprofilFaltOK';
}
if (document.BestForm.Fornamn.value == '')
{
Returmeddelande += '• Du har ikke angivet Fornavn:<br>';
document.BestForm.Fornamn.className='KundprofilFaltFEL';
document.BestForm.Fornamn.readOnly=false;
document.BestForm.Fornamn.style.backgroundColor = \"#ffffff\";
}
else if (felaktigatecken.test(document.BestForm.Fornamn.value))
{
Returmeddelande += '• Du har indtastet ugyldige tegn i Fornavn:<br>';
document.BestForm.Fornamn.className='KundprofilFaltFEL';
document.BestForm.Fornamn.readOnly=false;
document.BestForm.Fornamn.style.backgroundColor = \"#ffffff\";
}
else
{
document.BestForm.Fornamn.className='KundprofilFaltOK';
}
if (document.BestForm.Efternamn.value == '')
{
Returmeddelande += '• Du har ikke angivet Efternavn:<br>';
document.BestForm.Efternamn.className='KundprofilFaltFEL';
document.BestForm.Efternamn.readOnly=false;
document.BestForm.Efternamn.style.backgroundColor = \"#ffffff\";
}
else if (felaktigatecken.test(document.BestForm.Efternamn.value))
{
Returmeddelande += '• Du har indtastet ugyldige tegn i Efternavn:<br>';
document.BestForm.Efternamn.className='KundprofilFaltFEL';
document.BestForm.Efternamn.readOnly=false;
document.BestForm.Efternamn.style.backgroundColor = \"#ffffff\";
}
else
{
document.BestForm.Efternamn.className='KundprofilFaltOK';
}
if (document.BestForm.Adress.value == '')
{
Returmeddelande += '• Du har ikke angivet Leveringsadresse:<br>';
document.BestForm.Adress.className='KundprofilFaltFEL';
}
else if (/[><]/.test(document.BestForm.Adress.value))
{
Returmeddelande += '• Ogiltigt tecken i Leveringsadresse:<br>';
document.BestForm.Adress.className='KundprofilFaltFEL';
}
else if (felaktigatecken.test(document.BestForm.Adress.value))
{
Returmeddelande += '• Du har indtastet ugyldige tegn i Leveringsadresse:<br>';
document.BestForm.Efternamn.Adress='KundprofilFaltFEL';
}
else
{
document.BestForm.Adress.className='KundprofilFaltOK';
}
var zip_error = 0;
if (document.BestForm.Postnr.value == '')
{
Returmeddelande += '• Du har ikke angivet Postnr.:<br>';
document.BestForm.Postnr.className='KundprofilFaltFEL';
zip_error = 1;
}
else
{
document.BestForm.Postnr.className='KundprofilFaltOK';
}
if (!zip_error)
{
var zip = jQuery(\"#Postnr\").val();
var zip_min = jQuery(\"#Land option:selected\").data(\"zip-min\");
var zip_max = jQuery(\"#Land option:selected\").data(\"zip-max\");
var zip_match = jQuery(\"#Land option:selected\").data(\"zip-match\");
var zip_matches = 1;
if (zip_match && zip)
{
var regexp = new RegExp(zip_match);
zip_matches = regexp.test(zip);
}
if (zip.length < zip_min || zip.length > zip_max || !zip_matches)
{
Returmeddelande += \"• Ugyldigt postnummer<br>\";
document.BestForm.Postnr.className=\"KundprofilFaltFEL\";
}
else
{
document.BestForm.Postnr.className='KundprofilFaltOK';
}
} if (document.BestForm.Ort.value == '')
{
Returmeddelande += '• Du har ikke angivet By:<br>';
document.BestForm.Ort.className='KundprofilFaltFEL';
}
else if (felaktigatecken.test(document.BestForm.Ort.value))
{
Returmeddelande += '• Du har indtastet ugyldige tegn i By:<br>';
document.BestForm.Efternamn.Ort='KundprofilFaltFEL';
}
else
{
document.BestForm.Ort.className='KundprofilFaltOK';
}
if (document.BestForm.Land.value == '')
{
Returmeddelande += '• Du har ikke angivet Land:<br>';
document.BestForm.Land.className='KundprofilFaltFEL';
}
else
{
document.BestForm.Land.className='KundprofilFaltOK';
}
if (document.BestForm.Tel_Mobil_SMS_Avisering != undefined)
{
var Avisering_ID = '';
if (eval(\"document.BestForm.Avisering_ID.checked\") == true)
{
Avisering_ID = document.BestForm.Avisering_ID.value;
}
else
{
for (var i=0;i<document.BestForm.Avisering_ID.length;i++)
{
if (eval(\"document.BestForm.Avisering_ID[i].checked\") == true)
{
Avisering_ID = document.BestForm.Avisering_ID[i].value;
}
else
{
if (document.getElementById(\"Tel_Mobil_SMS_Avisering\"+document.BestForm.Avisering_ID[i].value) !== undefined && document.getElementById(\"Tel_Mobil_SMS_Avisering\"+document.BestForm.Avisering_ID[i].value) !== null)
{
document.getElementById(\"Tel_Mobil_SMS_Avisering\"+document.BestForm.Avisering_ID[i].value).value = '';
}
}
}
}
if (Avisering_ID != '')
{
if (document.getElementById(\"Tel_Mobil_SMS_Avisering\"+Avisering_ID) !== undefined && document.getElementById(\"Tel_Mobil_SMS_Avisering\"+Avisering_ID) !== null)
{
if (document.getElementById(\"Tel_Mobil_SMS_Avisering\"+Avisering_ID).value == '')
{
Returmeddelande += '• Du har ikke angivet <br>';
document.BestForm.Tel_Mobil_SMS_Avisering.className='KundprofilFaltFEL';
}
else
{
document.BestForm.Tel_Mobil_SMS_Avisering.className='KundprofilFaltOK';
}
}
if(typeof ValideraSMSAvisering == 'function') {
var msg = ValideraSMSAvisering(document.BestForm.Tel_Mobil_SMS_Avisering.value);
if (msg != '')
{
Returmeddelande += msg + \"<br>\";
document.BestForm.Tel_Mobil_SMS_Avisering.className='KundprofilFaltFEL';
}
}
}
}
if (document.BestForm.Epost.value == '')
{
Returmeddelande += '• Du har ikke angivet E-mail-adresse:<br>';
document.BestForm.Epost.className='KundprofilFaltFEL';
}
else if (!epost_korrekt.test(document.BestForm.Epost.value))
{
Returmeddelande += '• Den angivne e-mail-adresse er forkert.<br>';
document.BestForm.Epost.className='KundprofilFaltFEL';
}
else
{
document.BestForm.Epost.className='KundprofilFaltOK';
}
if(typeof ValideraEpost == 'function') {
var msg = ValideraEpost(document.BestForm.Epost.value);
if (msg != '')
{
Returmeddelande += msg + \"<br>\";
document.BestForm.Epost.className='KundprofilFaltFEL';
}
}
if ( pnr == '')
{
Returmeddelande += '• Du har ikke angivet dit CPR/CVR-nummer<br>';
document.BestForm.Pnr.className='KundprofilFaltFEL_Kort';
}
else if (!pnr_korrekt.test(pnr) || pnr.length < pnr_min || pnr.length > pnr_max)
{
Returmeddelande += '• Du har ikke angivet dit CPR/CVR-nummer korrekt (hhv. 10 eller 8\x{a0}cifre)<br>';
document.BestForm.Pnr.className='KundprofilFaltFEL_Kort';
}
else
{
document.BestForm.Pnr.className='KundprofilFaltOK_Kort';
}
if(typeof ValideraPnr == 'function') {
var msg = ValideraPnr(pnr);
if (msg != '')
{
Returmeddelande += msg + \"<br>\";
document.BestForm.Pnr.className='KundprofilFaltFEL_Kort';
}
}
if(!jQuery(\"#Adressblock input\").is(\":visible\"))
{
ingafaltfinns = \"Y\";
} if (Returmeddelande != '' && Returmeddelande != 'undefined')
{
var TextSomSkaVisas;
TextSomSkaVisas = '<br><h1><img src=\"/bilder/ibutik-a/symboler/varning.gif\" align=\"absmiddle\"> Der er opst\x{e5}et f\x{f8}lgende fejl:</h1><br><b>'+Returmeddelande;
TextSomSkaVisas += '</b><br><br>Juster dette, og fors\x{f8}g igen.';
TextSomSkaVisas += '<br><br><button type=\"button\" onclick=\"visa_dialogruta()\" id=\"Felmeddelande_stang\" class=\"btn btn--felmeddelande\">Luk »</button>';
visa_dialogruta(TextSomSkaVisas);
}
else if(ingafaltfinns !== undefined && ingafaltfinns !== ''){
var meddelandeAttVisa = \"<br><h1><img src='/bilder/ibutik-a/symboler/varning.gif' align='absmiddle'> Der er opst\x{e5}et f\x{f8}lgende fejl:</h1><br>\";
meddelandeAttVisa += \"<br><h4>Du skal logge p\x{e5} for at gennemf\x{f8}re k\x{f8}bet.</h4>\";
meddelandeAttVisa += \"<br><br><a href='#' onclick='visa_dialogruta()'>St\x{e4}ng »</a>\";
visa_dialogruta(meddelandeAttVisa);
}
else
{
var BCCheck = 0;
if (BCCheck == 0)
{
if (1 == 2) {}
else
{
if(typeof override_BestForm_submit == 'function')
{
return override_BestForm_submit();
}
else
{
document.BestForm.submit();
}
}
}
else
{
}
}
}
function visa_dialogruta(HTMLInnehall, TYP)
{
if((typeof dialogruta_before == 'function') && (typeof HTMLInnehall !== 'undefined'))
{
var returVarde = dialogruta_before(HTMLInnehall);
if (returVarde == false)
{
return;
}
}
if (TYP === 1)
{
jQuery('#dialogruta').addClass('EjLevererade');
}
else
{
jQuery('#dialogruta').removeClass('EjLevererade');
}
document.getElementById('Felmeddelande').innerHTML=HTMLInnehall;
dialogruteelement = document.getElementById(\"dialogruta\");
dialogruteelement.style.visibility = (dialogruteelement.style.visibility == \"visible\") ? \"hidden\" : \"visible\";
if (dialogruteelement.style.visibility == \"visible\")
{
dialogruteelement.style.height=(document.body.clientHeight + 200);
dialogruteelement.style.width=(document.body.clientWidth + 20);
if (typeof ScrollToCustom == 'function')
{
ScrollToCustom();
}
else
{
scroll(0,0);
} }
else
{
dialogruteelement.style.height=(document.body.clientHeight - 200);
dialogruteelement.style.width=(document.body.clientWidth - 20);
document.body.style.height=(document.body.clientHeight - 200);
document.body.style.width=(document.body.clientWidth - 20);
if (typeof ScrollToCustom != 'function')
{
scroll(1,1);
} }
if ((typeof dialogruta_close == 'function') && (typeof HTMLInnehall === 'undefined'))
{
dialogruta_close(HTMLInnehall);
}
}
function preventPaste(ctrlId)
{
if (jQuery('#' + ctrlId).length > 0) {
jQuery('#' + ctrlId).bind('paste', function(e) {
e.preventDefault();
});
}}
jQuery(document).ready(function() {
preventPaste(\"Epost_Repeterat\");
});
function Tel_Mobil_Utokad_Koll(IN_Land, IN_Tel_Mobil)
{
var Koll = \"SKIPPA\";
if (IN_Land !== '' && IN_Tel_Mobil !== '')
{
var Regex_hash = {};
if (Regex_hash[IN_Land] !== undefined && Regex_hash[IN_Land] !== null && Regex_hash[IN_Land] !== '')
{
if (Regex_hash[IN_Land].test(IN_Tel_Mobil))
{
Koll = \"OK\";
}
else
{
Koll = \"FEL\";
}
}
else
{
Koll = \"SKIPPA\";
}
}
return Koll;
}
function inloggadKollOmFaltFinns()
{
var inputfalttwo = jQuery(\"#Adressblock #Adressblock2 p[class]\");
if(inputfalttwo.length == 0)
{
var noFieldsTarget = jQuery(\"#Adressblock #Adressblock2\");
var hiddenPfield = '<input type=\"hidden\" name=\"InloggadIdToPass\" value=\"0\" />';
jQuery(noFieldsTarget).append(hiddenPfield);
}
}
//-->
</script>
<script language=\"JavaScript\">
<!--
function FlyttaVidMax(field,nastaFaltID){
if(field.value.length >= field.maxLength){
if (document.getElementById(nastaFaltID)) {
document.getElementById(nastaFaltID).focus();
}
}
}
function ShowHide(element)
{
if (document.getElementById(element).style.visibility == \"visible\")
{
document.getElementById(element).style.display = \"none\";
document.getElementById(element).style.visibility = \"hidden\";
}
else
{
document.getElementById(element).style.display = \"block\";
document.getElementById(element).style.visibility = \"visible\";
}
}
//-->
</script>
<script type=\"text/javascript\">
document.BestForm.action = '/cgi-bin/ibutik/AIR_ibutik.fcgi';
</script>
<style type=\"text/css\">
.visually-hidden:not(:focus):not(:active) {
clip: rect(0 0 0 0);
clip-path: inset(50%);
height: 1px;
overflow: hidden;
position: absolute;
white-space: nowrap;
width: 1px;
}
.visually-hidden {
all: unset;
}
.hide {
display: none;
}
.customerprofile-fieldset {
border: 0;
padding: 0;
margin: 0;
min-width: 0;
text-align: left;
display: flex;
flex-direction: column;
}
.customerprofile-fieldset legend {
font-weight: 600;
font-size: 1.2em;
text-align: left;
float: left;
display: contents;
}
.customerprofile-fieldset legend span {
display: contents;
}
.customerprofile-field {
box-sizing: border-box;
display: -ms-flexbox;
display: -webkit-box;
display: flex;
flex-wrap: wrap;
margin-bottom: 1em;
}
.customerprofile-field label, .customerprofile-field .ghostLabel {
box-sizing: border-box;
display: -ms-flexbox;
display: -webkit-box;
display: flex;
flex-wrap: wrap;
}
.customerprofile-field label, .customerprofile-field .ghostLabel, .customerprofile-field .error_text, .customerprofile-field input:not([type='checkbox']):not([type='radio']), .customerprofile-field select, .customerprofile-field textarea, .customerprofile-field a:not(.btn) {
width: 100%;
}
.customerprofile-field-disabled {
filter: grayscale(1) brightness(0.95);
cursor: not-allowed;
}
.customerprofile-field .error_text {
color: red;
}
.help_text__summary {
cursor: pointer;
}
form[name=\"BestForm\"].loading #BestFormSendBtn {
cursor: wait;
}
</style>
<script>
/* Present a general error message when the error was unknown */
function present_general_error(errortext){
console.log(\"present_general_error\")
var errormessage = document.querySelector('.BestFormErrormessage');
if(errormessage){
errormessage.classList.remove('hide');
}
}
/* Add change listner to Erbjud and Erbjud_Mobil to change the value of the checkbox */
['Erbjud', 'Erbjud_Mobil'].forEach(id => {
if (document.getElementById(id)){
document.getElementById(id).addEventListener('change', function(e) {
e.target.value = e.target.checked ? 'Y' : 'N';
});
}
});
/* Fetch GET request with error handling */
function _regValidation(submitButton)
{
/* Run extra script if it exisist */
if (typeof(regValidation_before)=== 'function')
{
/* If frontend needs to add script before the validation starts then they can just define a function by this name */
regValidation_before();
}
if (document.getElementsByName(\"AIR-EverythingInItsRightPlace\")[0] === undefined)
{
var hidden_input = document.createElement(\"input\");
hidden_input.setAttribute(\"type\", \"hidden\");
hidden_input.setAttribute(\"name\", \"AIR-EverythingInItsRightPlace\");
hidden_input.setAttribute(\"value\", \"AIR\");
document.forms['BestForm'].appendChild(hidden_input);
}
/* Start by adding a loading class and defining variables */
var form = submitButton.closest('form');
form.classList.add('loading');
var valid = true; /* we assume that everything is correct until proven wrong */
/* reset all fields to valid per default */
reset_invalid_fields(form);
/* convert checkbox checked attribute into value for formvar */
_check_contracts();
/* check age limit */
_check_age_limit();
const data = new URLSearchParams();
for ( var i = 0; i < form.elements.length; i++ ) {
var e = form.elements[i];
data.append(encodeURIComponent(e.name ? e.name : e.id), encodeURIComponent(e.value));
}
fetch('/cgi-bin/ibutik/AIR_ibutik.fcgi', {
method: 'POST',
body: data
})
.then(async response => {
const isJson = response.headers.get('content-type').includes('application/json');
const data = isJson ? await response.json() : null;
/* check for error response */
if (!response.ok)
{
var errortext = \"Svaret fra serveren returnerede en fejl. Gennemg\x{e5} formularen og pr\x{f8}v igen. Hvis problemet forts\x{e6}tter, kontakt butikken.\";
present_general_error(errortext);
/* get error message from body or default to response status, short-circuit evaluation */
const error = (data && data.message) || response.status;
return Promise.reject(error);
}
if(data.error)
{
/* display errors */
_displayErrors(data.invalid_fields);
valid = false;
}
else if(data.url)
{
/* No errors, continue to your page */
window.location.href = '/shop?funk=dinsida&tidigare_funk=' + data.url;
}
else
{
/* No errors, continue to your page */
window.location.href = '/shop?funk=dinsida';
}
/* If the form was invalid in some way we need to alert the user */
if (valid === false) {
present_errors(form);
}
form.classList.remove('loading');
})
.catch(error => {
console.error('AIR: There was an error when fetching. \\n', error);
form.classList.remove('loading');
var errortext = \"Kunne ikke n\x{e5} serveren. Gennemg\x{e5} formularen og pr\x{f8}v igen. Hvis problemet forts\x{e6}tter, kontakt butikken.\";
present_general_error(errortext);
});
/* Run extra script if it exisist */
if (typeof(regValidation_after)=== 'function')
{
/* If frontend needs to add script after the validation is done then they can just define a function by this name */
regValidation_after();
}
}
function _check_contracts() {
let contract_signed = document.querySelectorAll('.Snabbkassa_Kundfalt_Marginal.Avtal>input[type=\"hidden\"]');
contract_signed.forEach( contract => {
let contract_revision = document.querySelector('input[type=\"checkbox\"][name=\"' + contract.name + '\"]');
contract.value = (contract_revision.checked) ? \"1\" : \"0\";
});
}
function _check_age_limit() {
let ageLimit = document.querySelector('[name=\"Aldersgrans\"]');
console.log(ageLimit);
if(ageLimit){
ageLimit.value = (ageLimit.checked) ? \"J\" : \"N\";
}
}
function present_errors(formElement) {
/* Presents all errors in a single message box */
var invalidFields = formElement.querySelectorAll('.wrap-field input[aria-invalid=\"true\"]');
var errorDialog = document.querySelector('.BestFormErrormessage');
if(errorDialog){
errorDialog.classList.remove('hide');
}
if (invalidFields.length > 0){
var errorHTML = \"<p>Du har ikke udfyldt f\x{f8}lgende felter korrekt:</p>\";
errorHTML += \"<ul>\";
invalidFields.forEach( field => {
fieldDiv = field.closest('.wrap-field');
fieldFieldset= field.closest('fieldset');
errorHTML += \"<li>\";
errorHTML += \"<a href='#\" + fieldDiv.querySelector(\"[aria-invalid='true']\").id + \"'>\";
errorHTML += fieldDiv.querySelector(\".title\").innerHTML;
errorHTML += \"</a>\";
errorHTML += \"</li>\";
fieldDiv.classList.add(\"invalid\");
if(fieldFieldset) {
fieldFieldset.classList.add(\"invalid\");
};
});
errorHTML += \"</ul>\";
errorHTML += \"<p>Ved hvert forkert felt har vi skrevet, hvad der skal \x{e6}ndres. Juster venligst i overensstemmelse hermed og pr\x{f8}v igen.</p>\";
errorDialog.querySelector('.status_message__main').innerHTML = errorHTML;
}
var focusableElements = errorDialog.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type=\"text\"]:not([disabled]), input[type=\"radio\"]:not([disabled]), input[type=\"checkbox\"]:not([disabled]), select:not([disabled]), input[type=\"password\"]:not([disabled])');
var firstFocusableEl = focusableElements[0].focus();
};
function reset_invalid_fields(form) {
/* Remove the error messages if there is already an error message when the user clicks the submit button */
console.log('reset_invalid_fields');
try {
form.querySelectorAll(\".invalid\").forEach( field => {
field.classList.remove(\"invalid\");
});
var customerfields = form.querySelectorAll('.wrap-field');
customerfields.forEach( field => {
if(field.querySelector('[aria-invalid=\"true\"]')){
field.querySelector('[aria-invalid=\"true\"]').setAttribute('aria-invalid', 'false');
}
if(field.querySelector('[aria-describedby]')){
field.querySelector('[aria-describedby]').removeAttribute('aria-describedby');
}
field.querySelector('.error-message').innerHTML = \"\";
});
} catch (error) {
console.error('AIR: There was an error when resetting errors. \\n', error);
var errortext = \"Noget gik galt under nulstilling af fejlmeddelelser. Genindl\x{e6}s siden, gennemg\x{e5} formularen og pr\x{f8}v igen. Hvis problemet forts\x{e6}tter, kontakt butikken.\";
present_general_error(errortext);
}
}
function _displayErrors(data)
{
/* Displays an indivdual error message by each field, specifict to that input */
Object.keys(data).forEach(field_id => {
try {
var err_msg = data[field_id];
let field_elem;
if(field_id.includes('contract'))
{
/* Contracts have a different structure than regular fields */
field_elem = document.querySelector('input[type=\"checkbox\"][name=\"' + field_id + '\"]');
}
else if(field_id.includes('Pnr'))
{
/* Pnr also have a different structure than regular fields */
field_elem = document.getElementById('PNr')
}
else
{
field_elem = document.getElementById(field_id);
}
if(field_elem)
{
var field_wrap = field_elem.parentNode;
var errorHTML = field_wrap.querySelector('.error-message').innerHTML;
errorHTML += '<span>' + err_msg + '</span>';
field_wrap.querySelector('.error-message').innerHTML = errorHTML;
field_elem.setAttribute('aria-invalid', 'true');
field_elem.setAttribute('aria-describedby', field_wrap.querySelector('.error_text').getAttribute('id'));
field_wrap.classList.add('invalid');
};
} catch (error) {
console.error('AIR: There was an error when displaying errors. \\n', error);
var errortext = \"Noget gik galt under pr\x{e6}sentationen af fejlmeddelelser. Genindl\x{e6}s siden, gennemg\x{e5} formularen og pr\x{f8}v igen. Hvis problemet forts\x{e6}tter, kontakt butikken.\";
present_general_error(errortext);
}
});
}
/* If the profile was updated we show a success message */
function checkIfProfileUpdated() {
console.log('checkIfProfileUpdated');
if(getUrlParameter_customerprofile('updated')){
var urlParameter = getUrlParameter_customerprofile('updated');
try {
var successDialog = document.querySelector('.BestFormSucessmessage');
if(urlParameter === \"true\" && successDialog){
successDialog.classList.remove('hide');
var focusableElements = successDialog.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type=\"text\"]:not([disabled]), input[type=\"radio\"]:not([disabled]), input[type=\"checkbox\"]:not([disabled]), select:not([disabled]), input[type=\"password\"]:not([disabled])');
var firstFocusableEl = focusableElements[0].focus();
}
} catch (error) {
console.error(error);
} finally {
}
}
};
var getUrlParameter_customerprofile = function getUrlParameter_customerprofile(sParam) {
var sPageURL = window.location.search.substring(1),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return typeof sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);
}
}
return false;
};
document.addEventListener('DOMContentLoaded', function () {
checkIfProfileUpdated();
}, false);
</script>
</section>";
<section id=\"mypages-container\">
<form action=\"/RegistreraNyKund.php\" method=\"post\" name=\"BestForm\" >
<input type=\"hidden\" name=\"funk\" value=\"kund_ny_slutfor\">
<input type=\"hidden\" name=\"nastasteg\" value=\"ny\">
<span class=\"KundNyText\">
<h1 class=\"Dinsida_Topprubrik\">Opret ny kundeprofil</h1>
</span>
<span class=\"KundNyText\">
Oplysninger m\x{e6}rket med * er obligatoriske.<br><br>
</span>
<div id=\"Adressblock\" >
<p class=\"LankLoggain\">
<label class=\"Snabbkassa_Kunduppgift_Etiketter LankLoggaInSpan\"> </label>
<a href=\"javascript:ShowHide('AdressblockLoggain');ShowHide('Adressblock');\">
<i>Jeg har en konto og vil logge ind »</i>
</a>
</p>
<div id=\"Adressblock2\" >
<fieldset class=\"customerprofile-fieldset\" >
<legend>
Kundoplysninger<span class=\"colon\">:</span>
</legend>
<!-- default -->
<div
class=\"wrap-field customerprofile-field required \"
id=\"SKM_PNr\"
>
<label
for=\"PNr\"
>
<span class=\"title\">
CPR-nr./CVR-nr.:
</span>
<span class=\"required-icon\"><i class=\"far fa-star\" aria-label=\"Stjerne\" aria-hidden=\"true\"></i></span>
</label>
<input
type=\"text\"
aria-invalid=\"false\"
aria-errormessage=\"error_text_PNr\"
id=\"PNr\"
name=\"Pnr\"
size=\"15\"
class=\"KundprofilFaltOK_Kort\"
maxlength=\"15\"
required aria-required=\"true\"
>
<div id=\"error_text_PNr\" class=\"error_text\">
<span class=\"error-icon\"><i class=\"fas fa-exclamation-circle\" aria-hidden=\"true\"></i></span>
<span class=\"error-message\">Fejlmeddelelse: </span>
</div>
</div>
<p style=\"display:none;visibility:hidden;margin:0;padding:0\" id=\"LankKassanAngeAdress\"></p>
<p style=\"display:none;visibility:hidden;margin:0;padding:0\" id=\"LankKassanLogin\"></p>
<p style=\"display:none;visibility:hidden;margin:0;padding:0\" id=\"KreditorInfo\"></p>
<p style=\"display:none;visibility:hidden;margin:0;padding:5;background-color:#EEEEEE;width:100%\" id=\"KreditorArsinkomst\"></p>
<div
class=\"wrap-field customerprofile-field \"
id=\"SKM_Foretag\" style=\"display:none;visibility:hidden;margin:0;padding:0\"
>
<label
for=\"Foretag\"
>
<span class=\"title\">
Firmanavn:
</span>
</label>
<input
type=\"text\"
aria-invalid=\"false\"
aria-errormessage=\"error_text_Foretag\"
id=\"Foretag\"
name=\"Foretag\"
size=\"25\"
class=\"KundprofilFaltOK\"
maxlength=\"50\"
>
<div id=\"error_text_Foretag\" class=\"error_text\">
<span class=\"error-icon\"><i class=\"fas fa-exclamation-circle\" aria-hidden=\"true\"></i></span>
<span class=\"error-message\">Fejlmeddelelse: </span>
</div>
</div>
<div
class=\"wrap-field customerprofile-field required \"
id=\"SKM_Fornamn\"
>
<label
for=\"Fornamn\"
>
<span class=\"title\">
Fornavn:
</span>
<span class=\"required-icon\"><i class=\"far fa-star\" aria-label=\"Stjerne\" aria-hidden=\"true\"></i></span>
</label>
<input
type=\"text\"
aria-invalid=\"false\"
aria-errormessage=\"error_text_Fornamn\"
id=\"Fornamn\"
name=\"Fornamn\"
size=\"25\"
class=\"KundprofilFaltOK\"
maxlength=\"50\"
required aria-required=\"true\"
>
<div id=\"error_text_Fornamn\" class=\"error_text\">
<span class=\"error-icon\"><i class=\"fas fa-exclamation-circle\" aria-hidden=\"true\"></i></span>
<span class=\"error-message\">Fejlmeddelelse: </span>
</div>
</div>
<div
class=\"wrap-field customerprofile-field required \"
id=\"SKM_Efternamn\"
>
<label
for=\"Efternamn\"
>
<span class=\"title\">
Efternavn:
</span>
<span class=\"required-icon\"><i class=\"far fa-star\" aria-label=\"Stjerne\" aria-hidden=\"true\"></i></span>
</label>
<input
type=\"text\"
aria-invalid=\"false\"
aria-errormessage=\"error_text_Efternamn\"
id=\"Efternamn\"
name=\"Efternamn\"
size=\"25\"
class=\"KundprofilFaltOK\"
maxlength=\"50\"
required aria-required=\"true\"
>
<div id=\"error_text_Efternamn\" class=\"error_text\">
<span class=\"error-icon\"><i class=\"fas fa-exclamation-circle\" aria-hidden=\"true\"></i></span>
<span class=\"error-message\">Fejlmeddelelse: </span>
</div>
</div>
</fieldset>
<fieldset class=\"customerprofile-fieldset\" id=\"linkAdressBlockAnvnamn\">
<legend>
Brugernavn og adgangskode<span class=\"colon\">:</span>
</legend>
<div
class=\"wrap-field customerprofile-field required \"
id=\"SKM_Anvnamn\"
>
<label
for=\"Anvnamn\"
>
<span class=\"title\">
Brugernavn:
</span>
<span class=\"required-icon\"><i class=\"far fa-star\" aria-label=\"Stjerne\" aria-hidden=\"true\"></i></span>
</label>
<input
type=\"text\"
aria-invalid=\"false\"
aria-errormessage=\"error_text_Anvnamn\"
id=\"Anvnamn\"
name=\"Anvnamn\"
size=\"25\"
class=\"KundprofilFaltOK\"
required aria-required=\"true\"
>
<div id=\"error_text_Anvnamn\" class=\"error_text\">
<span class=\"error-icon\"><i class=\"fas fa-exclamation-circle\" aria-hidden=\"true\"></i></span>
<span class=\"error-message\">Fejlmeddelelse: </span>
</div>
</div>
<div
class=\"wrap-field customerprofile-field required \"
id=\"SKM_Losenord\"
>
<label
for=\"Losenord\"
>
<span class=\"title\">
Adgangskode:
</span>
<span class=\"required-icon\"><i class=\"far fa-star\" aria-label=\"Stjerne\" aria-hidden=\"true\"></i></span>
</label>
<input
type=\"password\"
aria-invalid=\"false\"
aria-errormessage=\"error_text_Losenord\"
id=\"Losenord\"
name=\"Losenord\"
size=\"25\"
class=\"KundprofilFaltOK\"
required aria-required=\"true\"
>
<div id=\"error_text_Losenord\" class=\"error_text\">
<span class=\"error-icon\"><i class=\"fas fa-exclamation-circle\" aria-hidden=\"true\"></i></span>
<span class=\"error-message\">Fejlmeddelelse: </span>
</div>
</div>
<div
class=\"wrap-field customerprofile-field required \"
id=\"SKM_Losenord_Repeterat\"
>
<label
for=\"Losenord_Repeterat\"
>
<span class=\"title\">
Gentag adgangskoden:
</span>
<span class=\"required-icon\"><i class=\"far fa-star\" aria-label=\"Stjerne\" aria-hidden=\"true\"></i></span>
</label>
<input
type=\"password\"
aria-invalid=\"false\"
aria-errormessage=\"error_text_Losenord_Repeterat\"
id=\"Losenord_Repeterat\"
name=\"Losenord_Repeterat\"
size=\"25\"
class=\"KundprofilFaltOK\"
required aria-required=\"true\"
>
<div id=\"error_text_Losenord_Repeterat\" class=\"error_text\">
<span class=\"error-icon\"><i class=\"fas fa-exclamation-circle\" aria-hidden=\"true\"></i></span>
<span class=\"error-message\">Fejlmeddelelse: </span>
</div>
</div>
</fieldset>
<fieldset class=\"customerprofile-fieldset\" id=\"linkAdressBlockLeveransadress\">
<legend>
Leveringsadresse<span class=\"colon\">:</span>
</legend>
<div
class=\"wrap-field customerprofile-field required \"
id=\"SKM_Adress\"
>
<label
for=\"Adress\"
>
<span class=\"title\">
Leveringsadresse:
</span>
<span class=\"required-icon\"><i class=\"far fa-star\" aria-label=\"Stjerne\" aria-hidden=\"true\"></i></span>
</label>
<input
type=\"text\"
aria-invalid=\"false\"
aria-errormessage=\"error_text_Adress\"
id=\"Adress\"
name=\"Adress\"
size=\"25\"
class=\"KundprofilFaltOK\"
required aria-required=\"true\"
>
<div id=\"error_text_Adress\" class=\"error_text\">
<span class=\"error-icon\"><i class=\"fas fa-exclamation-circle\" aria-hidden=\"true\"></i></span>
<span class=\"error-message\">Fejlmeddelelse: </span>
</div>
</div>
<div
class=\"wrap-field customerprofile-field required \"
id=\"SKM_Postnr\"
>
<label
for=\"Postnr\"
>
<span class=\"title\">
Postnr.:
</span>
<span class=\"required-icon\"><i class=\"far fa-star\" aria-label=\"Stjerne\" aria-hidden=\"true\"></i></span>
</label>
<input
type=\"text\"
aria-invalid=\"false\"
aria-errormessage=\"error_text_Postnr\"
id=\"Postnr\"
name=\"Postnr\"
size=\"25\"
class=\"KundprofilFaltOK\"
required aria-required=\"true\"
>
<div id=\"error_text_Postnr\" class=\"error_text\">
<span class=\"error-icon\"><i class=\"fas fa-exclamation-circle\" aria-hidden=\"true\"></i></span>
<span class=\"error-message\">Fejlmeddelelse: </span>
</div>
</div>
<div id=\"LaddaOmPostnr\" style=\"display:none;margin:0;margin-top:10px;margin-bottom:10px;padding:10px;background-color:#EEEEEE;width:100%;text-align:center;vertical-align:middle;\"><img src=\"/bilder/ibutik-a/loading.gif\"><br><br><i>Loading shipping options...</i></div>
<div
class=\"wrap-field customerprofile-field required \"
id=\"SKM_Ort\"
>
<label
for=\"Ort\"
>
<span class=\"title\">
By:
</span>
<span class=\"required-icon\"><i class=\"far fa-star\" aria-label=\"Stjerne\" aria-hidden=\"true\"></i></span>
</label>
<input
type=\"text\"
aria-invalid=\"false\"
aria-errormessage=\"error_text_Ort\"
id=\"Ort\"
name=\"Ort\"
size=\"25\"
class=\"KundprofilFaltOK\"
required aria-required=\"true\"
>
<div id=\"error_text_Ort\" class=\"error_text\">
<span class=\"error-icon\"><i class=\"fas fa-exclamation-circle\" aria-hidden=\"true\"></i></span>
<span class=\"error-message\">Fejlmeddelelse: </span>
</div>
</div>
<div
class=\"wrap-field customerprofile-field required \"
id=\"SKM_Land\"
>
<label
for=\"Land\"
>
<span class=\"title\">
Land:
</span>
<span class=\"required-icon\"><i class=\"far fa-star\" aria-label=\"Stjerne\" aria-hidden=\"true\"></i></span>
</label>
<div class=\"select-wrapper\">
<select
id=\"Land\"
name=\"Land\"
class=\"KundprofilFaltOK\"
required aria-required=\"true\"
aria-invalid=\"false\"
aria-errormessage=\"error_text_Land\"
>
<option value=\"\"></option> <option value=\"Denmark\" rel=\";;\" selected>Denmark</option>
</select>
</select>
</div>
<div id=\"error_text_Land\" class=\"error_text\">
<span class=\"error-icon\"><i class=\"fas fa-exclamation-circle\" aria-hidden=\"true\"></i></span>
<span class=\"error-message\">Fejlmeddelelse: </span>
</div>
</div>
<div id=\"LaddaOmLand\" style=\"display:none;margin:0;margin-top:10px;margin-bottom:10px;padding:10px;background-color:#EEEEEE;width:100%;text-align:center;vertical-align:middle;\"><img src=\"/bilder/ibutik-a/loading.gif\"><br><br><i>Loading shipping options...</i></div>
</fieldset>
<input type=\"hidden\" name=\"Adress2\" value=\"\">
<input type=\"hidden\" name=\"Adress2_Extra\" value=\"\">
<input type=\"hidden\" name=\"Adress2_Extra2\" value=\"\">
<input type=\"hidden\" name=\"Teldag2\" value=\"\">
<input type=\"hidden\" name=\"Fornamn2\" value=\"\">
<input type=\"hidden\" name=\"Efternamn2\" value=\"\">
<input type=\"hidden\" name=\"Postnr2\" value=\"\">
<input type=\"hidden\" name=\"Ort2\" value=\"\">
<input type=\"hidden\" name=\"Stat2\" value=\"\">
<input type=\"hidden\" name=\"Land2\" value=\"\">
<input type=\"hidden\" name=\"Foretag2\" value=\"\">
<input type=\"hidden\" name=\"Epost2\" value=\"\">
<input type=\"hidden\" name=\"Pnr2\" value=\"\">
<input type=\"hidden\" name=\"Adress2_Husnummer\" value=\"\">
<input type=\"hidden\" name=\"Adress2_Houseextension\" value=\"\">
<fieldset class=\"customerprofile-fieldset\" id=\"linkAdressBlockOvrigt\">
<legend>
\x{d8}vrige oplysninger<span class=\"colon\">:</span>
</legend>
<div
class=\"wrap-field customerprofile-field required \"
id=\"SKM_Epost\"
>
<label
for=\"Epost\"
>
<span class=\"title\">
E-mail-adresse:
</span>
<span class=\"required-icon\"><i class=\"far fa-star\" aria-label=\"Stjerne\" aria-hidden=\"true\"></i></span>
</label>
<input
type=\"text\"
aria-invalid=\"false\"
aria-errormessage=\"error_text_Epost\"
id=\"Epost\"
name=\"Epost\"
size=\"25\"
class=\"KundprofilFaltOK\"
required aria-required=\"true\"
>
<div id=\"error_text_Epost\" class=\"error_text\">
<span class=\"error-icon\"><i class=\"fas fa-exclamation-circle\" aria-hidden=\"true\"></i></span>
<span class=\"error-message\">Fejlmeddelelse: </span>
</div>
</div>
<div
class=\"wrap-field customerprofile-field \"
id=\"SKM_Teldag\"
>
<label
for=\"Teldag\"
>
<span class=\"title\">
Telefon:
</span>
</label>
<input
type=\"text\"
aria-invalid=\"false\"
aria-errormessage=\"error_text_Teldag\"
id=\"Teldag\"
name=\"Teldag\"
size=\"25\"
class=\"KundprofilFaltOK\"
>
<div id=\"error_text_Teldag\" class=\"error_text\">
<span class=\"error-icon\"><i class=\"fas fa-exclamation-circle\" aria-hidden=\"true\"></i></span>
<span class=\"error-message\">Fejlmeddelelse: </span>
</div>
</div>
</fieldset>
<p class=\"Snabbkassa_Kundfalt_Marginal BestFormSendBtn_wrap\" >
<button class=\"btn-auto btn-md\" type=\"button\" onclick=\"_regValidation(this);\" id=\"BestFormSendBtn\">
Gem
</a>
</button>
</p>
</div>
</div>
<div id=\"AdressblockPaminnare\" style=\"display:none;visibility:hidden\">
E-mail-adresse eller kundenummer:
<input type=\"text\" name=\"EpostPaminnelse\" size=\"20\" >
<button type=\"button\" onclick=\"AIR_Paminnare();\" >
Send oplysningerne nu »
</button>
<a href=\"javascript:ShowHide('AdressblockPaminnare');ShowHide('Adressblock');\">
Jeg vil angive nye adresseoplysninger »
</a>
</div>
</form>
<div id=\"dialogruta\">
<div id=\"Felmeddelande\">
</div>
</div>
<br>
<div class=\"status_message status_message-negative BestFormErrormessage hide\" role=\"alert\" data-errorcode=\"BestFormError\">
<div class=\"box\">
<i class=\"fas fa-exclamation-circle text-xl\" aria-hidden=\"true\"></i>
<span class=\"font-xl text-uppercase\">Fejlmeddelelse</span>
<div class=\"status_message__main\">Der skete en fejl under lagringen. Gennemg\x{e5} venligst formularen og pr\x{f8}v igen.</div>
<button type=\"button\" class=\"btn-auto btn-sm \" onclick=\"AIR_close_message(this)\" tabindex=\"0\">OK</button>
</div>
</div>
<script>
var AIR_close_message = function(button) {
button.closest('.status_message').classList.add('hide');
};
</script>
<br>
<form method=\"get\" action=\"/cgi-bin/ibutik/BC_HamtaInformation.pl\" name=\"FormHamtaAdressBC\" style=\"margin:0;padding:0\">
<input type=\"hidden\" name=\"CheckPoint\" value=\"FormHamtaAdressBC\">
<input type=\"hidden\" name=\"Pno1\" value=\"\">
<input type=\"hidden\" name=\"Typ\" value=\"Adress\">
<input type=\"hidden\" name=\"Ajax\" value=\"N\">
<input type=\"hidden\" name=\"Privat_Foretag\" value=\"\">
<input type=\"hidden\" name=\"AnropTyp\" value=\"KundNy\">
<input type=\"hidden\" name=\"ref\" value=\"\">
<input type=\"hidden\" name=\"Presentkort\" value=\"\">
<input type=\"hidden\" name=\"GodkannaVillkor\" value=\"\">
</form><script language=\"JavaScript\">
<!--
function AIR_HamtaAdressBC(pnrId)
{
var pnrObj = ''
if (document.BestForm.Pnr)
{
pnrObj = document.BestForm.Pnr
}
if (pnrObj === '')
{
pnrObj = document.getElementById(pnrId)
}
if(typeof ValideraPnrBC == 'function') {
var pnr = pnrObj.value
var retValue = ''
var msg = ValideraPnrBC(pnr);
if (msg != '')
{
retValue += msg + \"<br>\";
pnrObj.className='KundprofilFaltFEL_Kort';
}
else
{
pnrObj.className='KundprofilFaltOK_Kort';
}
}
else
{
pnrObj.className='KundprofilFaltOK_Kort';
}
if (typeof ValideraPnrBC == 'function' && retValue != '')
{
var dialogText = '<br><h1><img src=\"/bilder/ibutik-a/symboler/varning.gif\" align=\"absmiddle\"> Der er opst\x{e5}et f\x{f8}lgende fejl:</h1><br><b>'+retValue;
dialogText += '<br><br><a href=\\'#\\' onclick=\\'visa_dialogruta()\\'>Luk »</a>';
visa_dialogruta(dialogText);
return;
}
if ((document.FormHamtaAdressBC.GodkannaVillkor != undefined) && (document.getElementById('GodkannaVillkorCB') != undefined))
{
if (document.getElementById('GodkannaVillkorCB').checked == true)
{
document.FormHamtaAdressBC.GodkannaVillkor.value = document.getElementById('GodkannaVillkorCB').value;
}
}
var personnummer = pnrObj.value;
if (personnummer === '')
{
pnrObj = document.getElementById(pnrId);
}
document.FormHamtaAdressBC.Pno1.value = personnummer;
document.FormHamtaAdressBC.submit();
}
//-->
</script>
<form method=\"post\" action=\"/cgi-bin/ibutik/AIR_ibutik.fcgi\" name=\"LoggaIn\" style=\"margin:0;padding:0\">
<input type=\"hidden\" name=\"CheckPoint\" value=\"LoggaIn\">
<input type=\"hidden\" name=\"Anvnamn\" value=\"\">
<input type=\"hidden\" name=\"Losenord\" value=\"\">
<input type=\"hidden\" name=\"Betalning_ID\" value=\"\">
<input type=\"hidden\" name=\"Frakt_ID\" value=\"\">
<input type=\"hidden\" name=\"Avisering_ID\" value=\"\">
<input type=\"hidden\" name=\"funk\" value=\"kundprofil_inloggning_slutfor\">
<input type=\"hidden\" name=\"ref\" value=\"\">
<input type=\"hidden\" name=\"Presentkort\" value=\"\">
<input type=\"hidden\" name=\"GodkannaVillkor\" value=\"\">
</form><script language=\"JavaScript\">
<!--
function AIR_LoggaIn()
{
if ((document.LoggaIn.GodkannaVillkor != undefined) && (document.getElementById('GodkannaVillkorCB') != undefined))
{
if (document.getElementById('GodkannaVillkorCB').checked == true)
{
document.LoggaIn.GodkannaVillkor.value = document.getElementById('GodkannaVillkorCB').value;
}
}
if (document.BestForm.Betalning_ID != undefined)
{
if (eval(\"document.BestForm.Betalning_ID.checked\") == true)
{
document.LoggaIn.Betalning_ID.value = document.BestForm.Betalning_ID.value;
}
else
{
for (var i=0;i<document.BestForm.Betalning_ID.length;i++)
{
if (eval(\"document.BestForm.Betalning_ID[i].checked\") == true)
{
document.LoggaIn.Betalning_ID.value = document.BestForm.Betalning_ID[i].value;
}
}
}
}
if (document.BestForm.Frakt_ID != undefined)
{
if (eval(\"document.BestForm.Frakt_ID.checked\") == true)
{
document.LoggaIn.Frakt_ID.value = document.BestForm.Frakt_ID.value;
}
else
{
for (var i=0;i<document.BestForm.Frakt_ID.length;i++)
{
if (eval(\"document.BestForm.Frakt_ID[i].checked\") == true)
{
document.LoggaIn.Frakt_ID.value = document.BestForm.Frakt_ID[i].value;
}
}
}
}
if (document.BestForm.Avisering_ID != undefined)
{
if (eval(\"document.BestForm.Avisering_ID.checked\") == true)
{
document.LoggaIn.Avisering_ID.value = document.BestForm.Avisering_ID.value;
}
else
{
for (var i=0;i<document.BestForm.Avisering_ID.length;i++)
{
if (eval(\"document.BestForm.Avisering_ID[i].checked\") == true)
{
document.LoggaIn.Avisering_ID.value = document.BestForm.Avisering_ID[i].value;
}
}
}
}
document.LoggaIn.Anvnamn.value = document.BestForm.Loggain_Anvnamn.value;
document.LoggaIn.Losenord.value = document.BestForm.Loggain_Losenord.value;
if (typeof(checkout_login_ajax) == \"function\") {
checkout_login_ajax();
} else {
document.LoggaIn.submit();
}
}
//-->
</script>
<form method=\"post\" action=\"/cgi-bin/ibutik/AIR_ibutik.fcgi\" name=\"Paminnare\" style=\"margin:0;padding:0\">
<input type=\"hidden\" name=\"CheckPoint\" value=\"Paminnare\">
<input type=\"hidden\" name=\"Epost\" value=\"\">
<input type=\"hidden\" name=\"funk\" value=\"kund_skickapw_slutfor\">
<input type=\"hidden\" name=\"nastasteg\" value=\"\">
<input type=\"hidden\" name=\"ref\" value=\"\">
<input type=\"hidden\" name=\"Presentkort\" value=\"\">
<input type=\"hidden\" name=\"GodkannaVillkor\" value=\"\">
</form><script language=\"JavaScript\">
<!--
function AIR_Paminnare()
{
if ((document.Paminnare.GodkannaVillkor != undefined) && (document.getElementById('GodkannaVillkorCB') != undefined))
{
if (document.getElementById('GodkannaVillkorCB').checked == true)
{
document.Paminnare.GodkannaVillkor.value = document.getElementById('GodkannaVillkorCB').value;
}
}
document.Paminnare.Epost.value = document.BestForm.EpostPaminnelse.value;
document.Paminnare.nastasteg.value = document.BestForm.nastasteg.value;
document.Paminnare.submit();
}
//-->
</script>
<script language=\"JavaScript\">
<!--
var epost_korrekt = /^([A-Za-z0-9\\.\\_\\%\\+\\-])+\\\@([A-Za-z0-9\\-\\.])+\\.([A-Za-z]{2,})\$/;
var pnrextra_korrekt = /\\d{4}/;
var felaktigatecken = /([<>\"|;\\[\\]{}()])/;
function AIR_FaltKoll() {
if (document.getElementsByName(\"AIR-EverythingInItsRightPlace\")[0] === undefined)
{
var hidden_input = document.createElement(\"input\");
hidden_input.setAttribute(\"type\", \"hidden\");
hidden_input.setAttribute(\"name\", \"AIR-EverythingInItsRightPlace\");
hidden_input.setAttribute(\"value\", \"AIR\");
document.forms['BestForm'].appendChild(hidden_input);
}
if(typeof valideraFormular == 'function')
{
var returVarde = valideraFormular();
if (returVarde == false)
{
return;
}
}
if(typeof AIR_filtreraTextfalt == 'function'){AIR_filtreraTextfalt('BestForm');} var Returmeddelande = '';
var ingafaltfinns = ''
var invalid_inputs = document.BestForm.querySelectorAll(':invalid');
for (var i = 0; i < invalid_inputs.length; i++) {
if (invalid_inputs[i].dataset.component == 'contract')
{
Returmeddelande += \"• Du ikke har godkendt \" + invalid_inputs[i].dataset.label + \"<br>\";
}
} if(typeof ValideraAnpassadeFalt == 'function') { Returmeddelande += ValideraAnpassadeFalt();} if(typeof valideraDirektinlosen == 'function')
{
Returmeddelande += valideraDirektinlosen();
if (Returmeddelande != '')
{
jQuery('#presentkort_direktinlosen').attr(\"class\",\"KundprofilFaltFEL_Kort\");
}
else
{
jQuery('#presentkort_direktinlosen').attr(\"class\",\"KundprofilFaltOK_Kort\");
}
}
if(typeof valideraAlder == 'function')
{
Returmeddelande += valideraAlder();
if (Returmeddelande != '')
{
jQuery('#Pnr').attr(\"class\",\"KundprofilFaltFEL_Kort\");
}
else
{
jQuery('#Pnr').attr(\"class\",\"KundprofilFaltOK_Kort\");
}
}
var losenord_korrekt = /\\S{6}/;
pnr = document.BestForm.Pnr.value;
pnr_min = 7;
pnr_max = 16;
pnr_match = \"[0-9A-Za-z]\";
if(document.BestForm.Land !== undefined && document.BestForm.Land.selectedIndex !== undefined) {
landInfo = document.BestForm.Land.value;
opt_index = document.BestForm.Land.selectedIndex;
if(landInfo = document.BestForm.Land[opt_index].getAttribute('rel')) {
landInfoSplit = landInfo.split(\";\");
if((landInfoSplit[0] !== undefined && landInfoSplit[0] !== '') && (landInfoSplit[1] !== undefined && landInfoSplit[1] !== '') && (landInfoSplit[2] !== undefined && landInfoSplit[2] !== ''))
{
pnr_min = landInfoSplit[0];
pnr_max = landInfoSplit[1];
pnr_match = landInfoSplit[2];
}
else if(landInfoSplit[0] == '' && landInfoSplit[1] == '' && landInfoSplit[2] == '')
{
pnr_min = 7;
pnr_max = 16;
pnr_match = \"[0-9A-Za-z]\";
}
}
}
regExpText = pnr_match;if(pnr.length > 0) {
regExpText = regExpText + \"{\" + pnr.length + \"}\";
}
var pnr_korrekt = new RegExp(regExpText);
if(document.BestForm.Losenord_Repeterat)
{
if(!(losenord_korrekt.test(document.BestForm.Losenord.value)))
{
Returmeddelande += '• Adgangskoden er for kort (mindst 6 tegn) <br>';
document.BestForm.Losenord.className='KundprofilFaltFEL';
}
else if (document.BestForm.Losenord.value != document.BestForm.Losenord_Repeterat.value)
{
Returmeddelande += '• Adgangskoderne matcher ikke <br>';
document.BestForm.Losenord.className='KundprofilFaltFEL';
document.BestForm.Losenord_Repeterat.className='KundprofilFaltFEL';
}
else
{
document.BestForm.Losenord.className='KundprofilFaltOK';
document.BestForm.Losenord_Repeterat.className='KundprofilFaltOK';
}
}
if (document.BestForm.Anvnamn.value == '')
{
Returmeddelande += '• Du har ikke angivet et brugernavn <br>';
document.BestForm.Anvnamn.className='KundprofilFaltFEL';
}
else
{
document.BestForm.Anvnamn.className='KundprofilFaltOK';
}
if (document.BestForm.Fornamn.value == '')
{
Returmeddelande += '• Du har ikke angivet Fornavn:<br>';
document.BestForm.Fornamn.className='KundprofilFaltFEL';
document.BestForm.Fornamn.readOnly=false;
document.BestForm.Fornamn.style.backgroundColor = \"#ffffff\";
}
else if (felaktigatecken.test(document.BestForm.Fornamn.value))
{
Returmeddelande += '• Du har indtastet ugyldige tegn i Fornavn:<br>';
document.BestForm.Fornamn.className='KundprofilFaltFEL';
document.BestForm.Fornamn.readOnly=false;
document.BestForm.Fornamn.style.backgroundColor = \"#ffffff\";
}
else
{
document.BestForm.Fornamn.className='KundprofilFaltOK';
}
if (document.BestForm.Efternamn.value == '')
{
Returmeddelande += '• Du har ikke angivet Efternavn:<br>';
document.BestForm.Efternamn.className='KundprofilFaltFEL';
document.BestForm.Efternamn.readOnly=false;
document.BestForm.Efternamn.style.backgroundColor = \"#ffffff\";
}
else if (felaktigatecken.test(document.BestForm.Efternamn.value))
{
Returmeddelande += '• Du har indtastet ugyldige tegn i Efternavn:<br>';
document.BestForm.Efternamn.className='KundprofilFaltFEL';
document.BestForm.Efternamn.readOnly=false;
document.BestForm.Efternamn.style.backgroundColor = \"#ffffff\";
}
else
{
document.BestForm.Efternamn.className='KundprofilFaltOK';
}
if (document.BestForm.Adress.value == '')
{
Returmeddelande += '• Du har ikke angivet Leveringsadresse:<br>';
document.BestForm.Adress.className='KundprofilFaltFEL';
}
else if (/[><]/.test(document.BestForm.Adress.value))
{
Returmeddelande += '• Ogiltigt tecken i Leveringsadresse:<br>';
document.BestForm.Adress.className='KundprofilFaltFEL';
}
else if (felaktigatecken.test(document.BestForm.Adress.value))
{
Returmeddelande += '• Du har indtastet ugyldige tegn i Leveringsadresse:<br>';
document.BestForm.Efternamn.Adress='KundprofilFaltFEL';
}
else
{
document.BestForm.Adress.className='KundprofilFaltOK';
}
var zip_error = 0;
if (document.BestForm.Postnr.value == '')
{
Returmeddelande += '• Du har ikke angivet Postnr.:<br>';
document.BestForm.Postnr.className='KundprofilFaltFEL';
zip_error = 1;
}
else
{
document.BestForm.Postnr.className='KundprofilFaltOK';
}
if (!zip_error)
{
var zip = jQuery(\"#Postnr\").val();
var zip_min = jQuery(\"#Land option:selected\").data(\"zip-min\");
var zip_max = jQuery(\"#Land option:selected\").data(\"zip-max\");
var zip_match = jQuery(\"#Land option:selected\").data(\"zip-match\");
var zip_matches = 1;
if (zip_match && zip)
{
var regexp = new RegExp(zip_match);
zip_matches = regexp.test(zip);
}
if (zip.length < zip_min || zip.length > zip_max || !zip_matches)
{
Returmeddelande += \"• Ugyldigt postnummer<br>\";
document.BestForm.Postnr.className=\"KundprofilFaltFEL\";
}
else
{
document.BestForm.Postnr.className='KundprofilFaltOK';
}
} if (document.BestForm.Ort.value == '')
{
Returmeddelande += '• Du har ikke angivet By:<br>';
document.BestForm.Ort.className='KundprofilFaltFEL';
}
else if (felaktigatecken.test(document.BestForm.Ort.value))
{
Returmeddelande += '• Du har indtastet ugyldige tegn i By:<br>';
document.BestForm.Efternamn.Ort='KundprofilFaltFEL';
}
else
{
document.BestForm.Ort.className='KundprofilFaltOK';
}
if (document.BestForm.Land.value == '')
{
Returmeddelande += '• Du har ikke angivet Land:<br>';
document.BestForm.Land.className='KundprofilFaltFEL';
}
else
{
document.BestForm.Land.className='KundprofilFaltOK';
}
if (document.BestForm.Tel_Mobil_SMS_Avisering != undefined)
{
var Avisering_ID = '';
if (eval(\"document.BestForm.Avisering_ID.checked\") == true)
{
Avisering_ID = document.BestForm.Avisering_ID.value;
}
else
{
for (var i=0;i<document.BestForm.Avisering_ID.length;i++)
{
if (eval(\"document.BestForm.Avisering_ID[i].checked\") == true)
{
Avisering_ID = document.BestForm.Avisering_ID[i].value;
}
else
{
if (document.getElementById(\"Tel_Mobil_SMS_Avisering\"+document.BestForm.Avisering_ID[i].value) !== undefined && document.getElementById(\"Tel_Mobil_SMS_Avisering\"+document.BestForm.Avisering_ID[i].value) !== null)
{
document.getElementById(\"Tel_Mobil_SMS_Avisering\"+document.BestForm.Avisering_ID[i].value).value = '';
}
}
}
}
if (Avisering_ID != '')
{
if (document.getElementById(\"Tel_Mobil_SMS_Avisering\"+Avisering_ID) !== undefined && document.getElementById(\"Tel_Mobil_SMS_Avisering\"+Avisering_ID) !== null)
{
if (document.getElementById(\"Tel_Mobil_SMS_Avisering\"+Avisering_ID).value == '')
{
Returmeddelande += '• Du har ikke angivet <br>';
document.BestForm.Tel_Mobil_SMS_Avisering.className='KundprofilFaltFEL';
}
else
{
document.BestForm.Tel_Mobil_SMS_Avisering.className='KundprofilFaltOK';
}
}
if(typeof ValideraSMSAvisering == 'function') {
var msg = ValideraSMSAvisering(document.BestForm.Tel_Mobil_SMS_Avisering.value);
if (msg != '')
{
Returmeddelande += msg + \"<br>\";
document.BestForm.Tel_Mobil_SMS_Avisering.className='KundprofilFaltFEL';
}
}
}
}
if (document.BestForm.Epost.value == '')
{
Returmeddelande += '• Du har ikke angivet E-mail-adresse:<br>';
document.BestForm.Epost.className='KundprofilFaltFEL';
}
else if (!epost_korrekt.test(document.BestForm.Epost.value))
{
Returmeddelande += '• Den angivne e-mail-adresse er forkert.<br>';
document.BestForm.Epost.className='KundprofilFaltFEL';
}
else
{
document.BestForm.Epost.className='KundprofilFaltOK';
}
if(typeof ValideraEpost == 'function') {
var msg = ValideraEpost(document.BestForm.Epost.value);
if (msg != '')
{
Returmeddelande += msg + \"<br>\";
document.BestForm.Epost.className='KundprofilFaltFEL';
}
}
if ( pnr == '')
{
Returmeddelande += '• Du har ikke angivet dit CPR/CVR-nummer<br>';
document.BestForm.Pnr.className='KundprofilFaltFEL_Kort';
}
else if (!pnr_korrekt.test(pnr) || pnr.length < pnr_min || pnr.length > pnr_max)
{
Returmeddelande += '• Du har ikke angivet dit CPR/CVR-nummer korrekt (hhv. 10 eller 8\x{a0}cifre)<br>';
document.BestForm.Pnr.className='KundprofilFaltFEL_Kort';
}
else
{
document.BestForm.Pnr.className='KundprofilFaltOK_Kort';
}
if(typeof ValideraPnr == 'function') {
var msg = ValideraPnr(pnr);
if (msg != '')
{
Returmeddelande += msg + \"<br>\";
document.BestForm.Pnr.className='KundprofilFaltFEL_Kort';
}
}
if(!jQuery(\"#Adressblock input\").is(\":visible\"))
{
ingafaltfinns = \"Y\";
} if (Returmeddelande != '' && Returmeddelande != 'undefined')
{
var TextSomSkaVisas;
TextSomSkaVisas = '<br><h1><img src=\"/bilder/ibutik-a/symboler/varning.gif\" align=\"absmiddle\"> Der er opst\x{e5}et f\x{f8}lgende fejl:</h1><br><b>'+Returmeddelande;
TextSomSkaVisas += '</b><br><br>Juster dette, og fors\x{f8}g igen.';
TextSomSkaVisas += '<br><br><button type=\"button\" onclick=\"visa_dialogruta()\" id=\"Felmeddelande_stang\" class=\"btn btn--felmeddelande\">Luk »</button>';
visa_dialogruta(TextSomSkaVisas);
}
else if(ingafaltfinns !== undefined && ingafaltfinns !== ''){
var meddelandeAttVisa = \"<br><h1><img src='/bilder/ibutik-a/symboler/varning.gif' align='absmiddle'> Der er opst\x{e5}et f\x{f8}lgende fejl:</h1><br>\";
meddelandeAttVisa += \"<br><h4>Du skal logge p\x{e5} for at gennemf\x{f8}re k\x{f8}bet.</h4>\";
meddelandeAttVisa += \"<br><br><a href='#' onclick='visa_dialogruta()'>St\x{e4}ng »</a>\";
visa_dialogruta(meddelandeAttVisa);
}
else
{
var BCCheck = 0;
if (BCCheck == 0)
{
if (1 == 2) {}
else
{
if(typeof override_BestForm_submit == 'function')
{
return override_BestForm_submit();
}
else
{
document.BestForm.submit();
}
}
}
else
{
}
}
}
function visa_dialogruta(HTMLInnehall, TYP)
{
if((typeof dialogruta_before == 'function') && (typeof HTMLInnehall !== 'undefined'))
{
var returVarde = dialogruta_before(HTMLInnehall);
if (returVarde == false)
{
return;
}
}
if (TYP === 1)
{
jQuery('#dialogruta').addClass('EjLevererade');
}
else
{
jQuery('#dialogruta').removeClass('EjLevererade');
}
document.getElementById('Felmeddelande').innerHTML=HTMLInnehall;
dialogruteelement = document.getElementById(\"dialogruta\");
dialogruteelement.style.visibility = (dialogruteelement.style.visibility == \"visible\") ? \"hidden\" : \"visible\";
if (dialogruteelement.style.visibility == \"visible\")
{
dialogruteelement.style.height=(document.body.clientHeight + 200);
dialogruteelement.style.width=(document.body.clientWidth + 20);
if (typeof ScrollToCustom == 'function')
{
ScrollToCustom();
}
else
{
scroll(0,0);
} }
else
{
dialogruteelement.style.height=(document.body.clientHeight - 200);
dialogruteelement.style.width=(document.body.clientWidth - 20);
document.body.style.height=(document.body.clientHeight - 200);
document.body.style.width=(document.body.clientWidth - 20);
if (typeof ScrollToCustom != 'function')
{
scroll(1,1);
} }
if ((typeof dialogruta_close == 'function') && (typeof HTMLInnehall === 'undefined'))
{
dialogruta_close(HTMLInnehall);
}
}
function preventPaste(ctrlId)
{
if (jQuery('#' + ctrlId).length > 0) {
jQuery('#' + ctrlId).bind('paste', function(e) {
e.preventDefault();
});
}}
jQuery(document).ready(function() {
preventPaste(\"Epost_Repeterat\");
});
function Tel_Mobil_Utokad_Koll(IN_Land, IN_Tel_Mobil)
{
var Koll = \"SKIPPA\";
if (IN_Land !== '' && IN_Tel_Mobil !== '')
{
var Regex_hash = {};
if (Regex_hash[IN_Land] !== undefined && Regex_hash[IN_Land] !== null && Regex_hash[IN_Land] !== '')
{
if (Regex_hash[IN_Land].test(IN_Tel_Mobil))
{
Koll = \"OK\";
}
else
{
Koll = \"FEL\";
}
}
else
{
Koll = \"SKIPPA\";
}
}
return Koll;
}
function inloggadKollOmFaltFinns()
{
var inputfalttwo = jQuery(\"#Adressblock #Adressblock2 p[class]\");
if(inputfalttwo.length == 0)
{
var noFieldsTarget = jQuery(\"#Adressblock #Adressblock2\");
var hiddenPfield = '<input type=\"hidden\" name=\"InloggadIdToPass\" value=\"0\" />';
jQuery(noFieldsTarget).append(hiddenPfield);
}
}
//-->
</script>
<script language=\"JavaScript\">
<!--
function FlyttaVidMax(field,nastaFaltID){
if(field.value.length >= field.maxLength){
if (document.getElementById(nastaFaltID)) {
document.getElementById(nastaFaltID).focus();
}
}
}
function ShowHide(element)
{
if (document.getElementById(element).style.visibility == \"visible\")
{
document.getElementById(element).style.display = \"none\";
document.getElementById(element).style.visibility = \"hidden\";
}
else
{
document.getElementById(element).style.display = \"block\";
document.getElementById(element).style.visibility = \"visible\";
}
}
//-->
</script>
<script type=\"text/javascript\">
document.BestForm.action = '/cgi-bin/ibutik/AIR_ibutik.fcgi';
</script>
<style type=\"text/css\">
.visually-hidden:not(:focus):not(:active) {
clip: rect(0 0 0 0);
clip-path: inset(50%);
height: 1px;
overflow: hidden;
position: absolute;
white-space: nowrap;
width: 1px;
}
.visually-hidden {
all: unset;
}
.hide {
display: none;
}
.customerprofile-fieldset {
border: 0;
padding: 0;
margin: 0;
min-width: 0;
text-align: left;
display: flex;
flex-direction: column;
}
.customerprofile-fieldset legend {
font-weight: 600;
font-size: 1.2em;
text-align: left;
float: left;
display: contents;
}
.customerprofile-fieldset legend span {
display: contents;
}
.customerprofile-field {
box-sizing: border-box;
display: -ms-flexbox;
display: -webkit-box;
display: flex;
flex-wrap: wrap;
margin-bottom: 1em;
}
.customerprofile-field label, .customerprofile-field .ghostLabel {
box-sizing: border-box;
display: -ms-flexbox;
display: -webkit-box;
display: flex;
flex-wrap: wrap;
}
.customerprofile-field label, .customerprofile-field .ghostLabel, .customerprofile-field .error_text, .customerprofile-field input:not([type='checkbox']):not([type='radio']), .customerprofile-field select, .customerprofile-field textarea, .customerprofile-field a:not(.btn) {
width: 100%;
}
.customerprofile-field-disabled {
filter: grayscale(1) brightness(0.95);
cursor: not-allowed;
}
.customerprofile-field .error_text {
color: red;
}
.help_text__summary {
cursor: pointer;
}
form[name=\"BestForm\"].loading #BestFormSendBtn {
cursor: wait;
}
</style>
<script>
/* Present a general error message when the error was unknown */
function present_general_error(errortext){
console.log(\"present_general_error\")
var errormessage = document.querySelector('.BestFormErrormessage');
if(errormessage){
errormessage.classList.remove('hide');
}
}
/* Add change listner to Erbjud and Erbjud_Mobil to change the value of the checkbox */
['Erbjud', 'Erbjud_Mobil'].forEach(id => {
if (document.getElementById(id)){
document.getElementById(id).addEventListener('change', function(e) {
e.target.value = e.target.checked ? 'Y' : 'N';
});
}
});
/* Fetch GET request with error handling */
function _regValidation(submitButton)
{
/* Run extra script if it exisist */
if (typeof(regValidation_before)=== 'function')
{
/* If frontend needs to add script before the validation starts then they can just define a function by this name */
regValidation_before();
}
if (document.getElementsByName(\"AIR-EverythingInItsRightPlace\")[0] === undefined)
{
var hidden_input = document.createElement(\"input\");
hidden_input.setAttribute(\"type\", \"hidden\");
hidden_input.setAttribute(\"name\", \"AIR-EverythingInItsRightPlace\");
hidden_input.setAttribute(\"value\", \"AIR\");
document.forms['BestForm'].appendChild(hidden_input);
}
/* Start by adding a loading class and defining variables */
var form = submitButton.closest('form');
form.classList.add('loading');
var valid = true; /* we assume that everything is correct until proven wrong */
/* reset all fields to valid per default */
reset_invalid_fields(form);
/* convert checkbox checked attribute into value for formvar */
_check_contracts();
/* check age limit */
_check_age_limit();
const data = new URLSearchParams();
for ( var i = 0; i < form.elements.length; i++ ) {
var e = form.elements[i];
data.append(encodeURIComponent(e.name ? e.name : e.id), encodeURIComponent(e.value));
}
fetch('/cgi-bin/ibutik/AIR_ibutik.fcgi', {
method: 'POST',
body: data
})
.then(async response => {
const isJson = response.headers.get('content-type').includes('application/json');
const data = isJson ? await response.json() : null;
/* check for error response */
if (!response.ok)
{
var errortext = \"Svaret fra serveren returnerede en fejl. Gennemg\x{e5} formularen og pr\x{f8}v igen. Hvis problemet forts\x{e6}tter, kontakt butikken.\";
present_general_error(errortext);
/* get error message from body or default to response status, short-circuit evaluation */
const error = (data && data.message) || response.status;
return Promise.reject(error);
}
if(data.error)
{
/* display errors */
_displayErrors(data.invalid_fields);
valid = false;
}
else if(data.url)
{
/* No errors, continue to your page */
window.location.href = '/shop?funk=dinsida&tidigare_funk=' + data.url;
}
else
{
/* No errors, continue to your page */
window.location.href = '/shop?funk=dinsida';
}
/* If the form was invalid in some way we need to alert the user */
if (valid === false) {
present_errors(form);
}
form.classList.remove('loading');
})
.catch(error => {
console.error('AIR: There was an error when fetching. \\n', error);
form.classList.remove('loading');
var errortext = \"Kunne ikke n\x{e5} serveren. Gennemg\x{e5} formularen og pr\x{f8}v igen. Hvis problemet forts\x{e6}tter, kontakt butikken.\";
present_general_error(errortext);
});
/* Run extra script if it exisist */
if (typeof(regValidation_after)=== 'function')
{
/* If frontend needs to add script after the validation is done then they can just define a function by this name */
regValidation_after();
}
}
function _check_contracts() {
let contract_signed = document.querySelectorAll('.Snabbkassa_Kundfalt_Marginal.Avtal>input[type=\"hidden\"]');
contract_signed.forEach( contract => {
let contract_revision = document.querySelector('input[type=\"checkbox\"][name=\"' + contract.name + '\"]');
contract.value = (contract_revision.checked) ? \"1\" : \"0\";
});
}
function _check_age_limit() {
let ageLimit = document.querySelector('[name=\"Aldersgrans\"]');
console.log(ageLimit);
if(ageLimit){
ageLimit.value = (ageLimit.checked) ? \"J\" : \"N\";
}
}
function present_errors(formElement) {
/* Presents all errors in a single message box */
var invalidFields = formElement.querySelectorAll('.wrap-field input[aria-invalid=\"true\"]');
var errorDialog = document.querySelector('.BestFormErrormessage');
if(errorDialog){
errorDialog.classList.remove('hide');
}
if (invalidFields.length > 0){
var errorHTML = \"<p>Du har ikke udfyldt f\x{f8}lgende felter korrekt:</p>\";
errorHTML += \"<ul>\";
invalidFields.forEach( field => {
fieldDiv = field.closest('.wrap-field');
fieldFieldset= field.closest('fieldset');
errorHTML += \"<li>\";
errorHTML += \"<a href='#\" + fieldDiv.querySelector(\"[aria-invalid='true']\").id + \"'>\";
errorHTML += fieldDiv.querySelector(\".title\").innerHTML;
errorHTML += \"</a>\";
errorHTML += \"</li>\";
fieldDiv.classList.add(\"invalid\");
if(fieldFieldset) {
fieldFieldset.classList.add(\"invalid\");
};
});
errorHTML += \"</ul>\";
errorHTML += \"<p>Ved hvert forkert felt har vi skrevet, hvad der skal \x{e6}ndres. Juster venligst i overensstemmelse hermed og pr\x{f8}v igen.</p>\";
errorDialog.querySelector('.status_message__main').innerHTML = errorHTML;
}
var focusableElements = errorDialog.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type=\"text\"]:not([disabled]), input[type=\"radio\"]:not([disabled]), input[type=\"checkbox\"]:not([disabled]), select:not([disabled]), input[type=\"password\"]:not([disabled])');
var firstFocusableEl = focusableElements[0].focus();
};
function reset_invalid_fields(form) {
/* Remove the error messages if there is already an error message when the user clicks the submit button */
console.log('reset_invalid_fields');
try {
form.querySelectorAll(\".invalid\").forEach( field => {
field.classList.remove(\"invalid\");
});
var customerfields = form.querySelectorAll('.wrap-field');
customerfields.forEach( field => {
if(field.querySelector('[aria-invalid=\"true\"]')){
field.querySelector('[aria-invalid=\"true\"]').setAttribute('aria-invalid', 'false');
}
if(field.querySelector('[aria-describedby]')){
field.querySelector('[aria-describedby]').removeAttribute('aria-describedby');
}
field.querySelector('.error-message').innerHTML = \"\";
});
} catch (error) {
console.error('AIR: There was an error when resetting errors. \\n', error);
var errortext = \"Noget gik galt under nulstilling af fejlmeddelelser. Genindl\x{e6}s siden, gennemg\x{e5} formularen og pr\x{f8}v igen. Hvis problemet forts\x{e6}tter, kontakt butikken.\";
present_general_error(errortext);
}
}
function _displayErrors(data)
{
/* Displays an indivdual error message by each field, specifict to that input */
Object.keys(data).forEach(field_id => {
try {
var err_msg = data[field_id];
let field_elem;
if(field_id.includes('contract'))
{
/* Contracts have a different structure than regular fields */
field_elem = document.querySelector('input[type=\"checkbox\"][name=\"' + field_id + '\"]');
}
else if(field_id.includes('Pnr'))
{
/* Pnr also have a different structure than regular fields */
field_elem = document.getElementById('PNr')
}
else
{
field_elem = document.getElementById(field_id);
}
if(field_elem)
{
var field_wrap = field_elem.parentNode;
var errorHTML = field_wrap.querySelector('.error-message').innerHTML;
errorHTML += '<span>' + err_msg + '</span>';
field_wrap.querySelector('.error-message').innerHTML = errorHTML;
field_elem.setAttribute('aria-invalid', 'true');
field_elem.setAttribute('aria-describedby', field_wrap.querySelector('.error_text').getAttribute('id'));
field_wrap.classList.add('invalid');
};
} catch (error) {
console.error('AIR: There was an error when displaying errors. \\n', error);
var errortext = \"Noget gik galt under pr\x{e6}sentationen af fejlmeddelelser. Genindl\x{e6}s siden, gennemg\x{e5} formularen og pr\x{f8}v igen. Hvis problemet forts\x{e6}tter, kontakt butikken.\";
present_general_error(errortext);
}
});
}
/* If the profile was updated we show a success message */
function checkIfProfileUpdated() {
console.log('checkIfProfileUpdated');
if(getUrlParameter_customerprofile('updated')){
var urlParameter = getUrlParameter_customerprofile('updated');
try {
var successDialog = document.querySelector('.BestFormSucessmessage');
if(urlParameter === \"true\" && successDialog){
successDialog.classList.remove('hide');
var focusableElements = successDialog.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type=\"text\"]:not([disabled]), input[type=\"radio\"]:not([disabled]), input[type=\"checkbox\"]:not([disabled]), select:not([disabled]), input[type=\"password\"]:not([disabled])');
var firstFocusableEl = focusableElements[0].focus();
}
} catch (error) {
console.error(error);
} finally {
}
}
};
var getUrlParameter_customerprofile = function getUrlParameter_customerprofile(sParam) {
var sPageURL = window.location.search.substring(1),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return typeof sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);
}
}
return false;
};
document.addEventListener('DOMContentLoaded', function () {
checkIfProfileUpdated();
}, false);
</script>
</section>";