For å fullføre kurset må du registreres direkte inn til Sjøfartsdirektoratet.
Har du et personnummer kan du skrive det inn i feltet nedenfor som sender det direkte til Sjøfartsdirektoratet. Dette blir sjekket mot fødselsnummeret hentet fra Vipps-kontoen du er logget inn med.
Har du ikke et slikt nummer må du sende oss D-nummer (hvis du har det) og fullt navn. Du kan bruke kontaktskjemaet under.
Selvregistrering
b24dec60cc
/* Overstyrre CSS så knappen faktisk blir grået ut når knappen er disabled. */
#btnOppgi[disabled] {
opacity: 0.5;
cursor: not-allowed;
}
/* Fjerne “avslutt” frem til bruker har trykket */
/* #avslutt {
display: none;
} */
Skriv inn et gyldig fødselsnummer. Feks. 22067612345.
let txtResponse = document.getElementById(‘txtResponse’);
let txtNummer = document.getElementById(‘txtNummer’);
let btnOppgi = document.getElementById(‘btnOppgi’);
let regex1 = /^(0[1-9]|[1-2][0-9]|31(?!(?:0[2469]|11))|30(?!02))(0[1-9]|1[0-2])(d{2})(.?)(d{5})$/; // Fødselsnummer. Feks 22067612345, http://fnrinfo.no/verktoy/finnlovlige.aspx
let regex2 = /^([1-9][1-9]|[1-2][0-9]|31(?!(?:0[2469]|11))|30(?!02))(0[1-9]|1[0-2])(d{2})(s?)(d{5})$/; // D-nummer. Feks 41018512345
// La kun tall skrives i input-feltet
function isNumberKey(evt) {
var charCode = (evt.which) ? evt.which : evt.keyCode
if (charCode > 31 && (charCode 57))
return false;
return true;
}
// Sjekke om tekstfeltet inneholder gyldig fødselsnummer eller D-nummer
txtNummer.addEventListener(‘input’, function() {
// Hvis input matcher regex, aktiver submit-knapp
if (regex1.test(txtNummer.value) || regex2.test(txtNummer.value)) {
btnOppgi.disabled = false;
txtResponse.textContent = “Gyldig nummer. Trykk ‘Oppgi’ for å sende.”;
} else {
btnOppgi.disabled = true;
txtResponse.textContent = “Skriv inn et gyldig fødselsnummer. Feks. 22067612345.”;
}
});
// Hvis knapp trykker, send API-request og vis “avslutt”
// https://kurs.sailon.no/wp-json/kursreg/v1/reg/?P18020084592
document.getElementById(‘formNummer’).addEventListener(‘submit’, function(event) {
document.getElementById(‘avslutt’).style.display = ‘block’;
event.preventDefault();
fetch(‘https://kurs.sailon.no/wp-json/kursreg/v1/reg/’, {
method: ‘POST’,
credentials: ‘include’,
headers: {
‘Content-Type’: ‘application/json’,
‘X-WP-Nonce’: document.getElementById(‘kursreg_nonce’).innerText,
},
body: JSON.stringify({
varPersonID: txtNummer.value
})
})
.then(response => response.json())
.then(data => {
if (data.message) {
txtResponse.textContent = data.message;
} else {
txtResponse.textContent = JSON.stringify(data);
}
})
.catch(error => {
console.error(‘Error:’, error);
txtResponse.textContent = “FEIL: “.JSON.stringify(error);
});
});
<!–
HTML-kode for "avslutt"-knapp
SailOn AS benytter informasjonskapsler (Cookies) for bedre brukeropplevelse ved å huske dine innstillinger og besøk på nettisiden. Ved å trykke "Godta" gir du tillatelse til bruk av alle informasjonskapsler. Du kan endre på disse innstillingene ved å trykke på Innstillinger.
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
Infokapsel
Varighet
Beskrivelse
cookielawinfo-checkbox-analytics
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional
11 months
The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy
11 months
The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.