person: add show/hide on marital status date

This commit is contained in:
nobohan
2021-06-24 08:25:55 +02:00
parent 504b2efacf
commit c23ada3533
3 changed files with 37 additions and 4 deletions

View File

@@ -1,10 +1,29 @@
import { ShowHide } from 'ShowHide/show_hide.js';
const maritalStatus = document.getElementById("maritalStatus");
const maritalStatusDate = document.getElementById("maritalStatusDate");
const personEmail = document.getElementById("personEmail");
const personAcceptEmail = document.getElementById("personAcceptEmail");
const personPhoneNumber = document.getElementById("personPhoneNumber");
const personAcceptSMS = document.getElementById("personAcceptSMS");
new ShowHide({
froms: [maritalStatus],
container: [maritalStatusDate],
test: function(froms) {
for (let f of froms.values()) {
for (let input of f.querySelectorAll('select').values()) {
if (input.value) {
return true
}
}
}
return false;
},
event_name: 'change'
});
new ShowHide({
froms: [personEmail],
container: [personAcceptEmail],