Object generated from form and url
Signed-off-by: Eoghan Conlon <eoghanconlon73@skynet.ie>
This commit is contained in:
parent
d8591575b1
commit
49a5878460
1 changed files with 5 additions and 1 deletions
|
@ -30,7 +30,11 @@
|
|||
const formData = new FormData(formEl);
|
||||
const pass = formData.get("password");
|
||||
if(pass === formData.get("confirm")){
|
||||
alert("Passwords match");
|
||||
const url = new URL(window.location.href);
|
||||
const urlParam = new URLSearchParams(url.search);
|
||||
const auth = urlParam.get("auth");
|
||||
const object = {auth: auth, pass: pass };
|
||||
alert(JSON.stringify(object));
|
||||
} else {
|
||||
document.getElementById('formStatus').innerHTML = "<span style='background-color: red; color: white'>Failure: Passwords don't match</span>";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue