Make email field mandatory

This commit is contained in:
Kuba Orlik 2023-02-09 13:05:02 +01:00
parent b3d46f238e
commit f22d3f7cd5

View File

@ -235,8 +235,13 @@
legal.style.setProperty("font-size", "1.333rem") legal.style.setProperty("font-size", "1.333rem")
legal.style.setProperty("line-height", "150%") legal.style.setProperty("line-height", "150%")
document.querySelector("#isso-thread .auth-section").insertBefore(legal, document.querySelector(".auth-section .post-action")) document.querySelector("#isso-thread .auth-section").insertBefore(legal, document.querySelector(".auth-section .post-action"))
const email_input = document.querySelector("#isso-thread").querySelector(`input[type="email"]`)
email_input.placeholder = "adres E-mail";
email_input.required = true;
faux_submit.addEventListener("click", ()=>{ faux_submit.addEventListener("click", ()=>{
if (!checkbox.checked) { if(!email_input.validity.valid){
email_input.reportValidity()
}else if(!checkbox.checked){
checkbox.reportValidity() checkbox.reportValidity()
}else { }else {
original_submit.click() original_submit.click()