Make email field mandatory
This commit is contained in:
parent
b3d46f238e
commit
f22d3f7cd5
7
post.hbs
7
post.hbs
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user