Make email field mandatory
This commit is contained in:
parent
b3d46f238e
commit
f22d3f7cd5
17
post.hbs
17
post.hbs
|
@ -235,12 +235,17 @@
|
|||
legal.style.setProperty("font-size", "1.333rem")
|
||||
legal.style.setProperty("line-height", "150%")
|
||||
document.querySelector("#isso-thread .auth-section").insertBefore(legal, document.querySelector(".auth-section .post-action"))
|
||||
faux_submit.addEventListener("click", () => {
|
||||
if (!checkbox.checked) {
|
||||
checkbox.reportValidity()
|
||||
} else {
|
||||
original_submit.click()
|
||||
}
|
||||
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", ()=>{
|
||||
if(!email_input.validity.valid){
|
||||
email_input.reportValidity()
|
||||
}else if(!checkbox.checked){
|
||||
checkbox.reportValidity()
|
||||
}else {
|
||||
original_submit.click()
|
||||
}
|
||||
})
|
||||
original_submit.parentElement.appendChild(faux_submit)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user