mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
person: avoid js error when personAcceptEmail is null
This commit is contained in:
parent
bddcdd7de2
commit
1dbf29beea
@ -7,7 +7,6 @@ const personAcceptEmail = document.getElementById("personAcceptEmail");
|
||||
const personPhoneNumber = document.getElementById("personPhoneNumber");
|
||||
const personAcceptSMS = document.getElementById("personAcceptSMS");
|
||||
|
||||
|
||||
new ShowHide({
|
||||
froms: [maritalStatus],
|
||||
container: [maritalStatusDate],
|
||||
@ -24,21 +23,24 @@ new ShowHide({
|
||||
event_name: 'change'
|
||||
});
|
||||
|
||||
new ShowHide({
|
||||
froms: [personEmail],
|
||||
container: [personAcceptEmail],
|
||||
test: function(froms) {
|
||||
for (let f of froms.values()) {
|
||||
for (let input of f.querySelectorAll('input').values()) {
|
||||
if (input.value) {
|
||||
return true
|
||||
if (personAcceptEmail) {
|
||||
new ShowHide({
|
||||
froms: [personEmail],
|
||||
container: [personAcceptEmail],
|
||||
test: function(froms) {
|
||||
for (let f of froms.values()) {
|
||||
for (let input of f.querySelectorAll('input').values()) {
|
||||
if (input.value) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
event_name: 'input'
|
||||
});
|
||||
return false;
|
||||
},
|
||||
event_name: 'input'
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
new ShowHide({
|
||||
froms: [personPhoneNumber],
|
||||
|
Loading…
x
Reference in New Issue
Block a user