added stuff in pair programming session
This commit is contained in:
11
js/app.js
Normal file
11
js/app.js
Normal file
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
$(document).ready(function () {
|
||||
$('#top_nav_bar').load('../components/top_nav.html');
|
||||
$('#main_nav_bar').load('../components/main_nav.html');
|
||||
$('#mmlcarousel').load('../components/banner.html');
|
||||
$('#mmlMainContent').load('../components/ftProducts.html');
|
||||
$('#marmeladenladen_footer').load('../components/footer.html');
|
||||
$('#marmeladenladen_search').load('../components/modal.html');
|
||||
$('#marmeladenladenLogin').load('../components/loginModal.html');
|
||||
$('#marmeladenladenRegister').load('../components/registerModal.html');
|
||||
});
|
||||
28
js/registration.js
Normal file
28
js/registration.js
Normal file
@@ -0,0 +1,28 @@
|
||||
const email = document.getElementById('email');
|
||||
const password = document.getElementById('password');
|
||||
const password2 = document.getElementById('password2');
|
||||
password2.addEventListener('change', checkPassword);
|
||||
|
||||
|
||||
|
||||
function register() {
|
||||
if (!checkPassword()) {
|
||||
return;
|
||||
}
|
||||
const form = document.querySelector('#marmeladenLadenRegisterForm');
|
||||
var formData = new FormData(form);
|
||||
const jSONdata = JSON.stringify(Object.fromEntries(formData));
|
||||
|
||||
//print elements of jSONdata
|
||||
console.log(jSONdata);
|
||||
}
|
||||
|
||||
function checkPassword() {
|
||||
if (password.value != password2.value) {
|
||||
password2.setCustomValidity('Passwords do not match');
|
||||
return false;
|
||||
} else {
|
||||
password2.setCustomValidity('');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user