registration other information fields mandatory

hello all, how do mandatory “mail” field? if “mail” field is emty, then “phone number” field is mandatory. else if “mail” field is full, then “phone number” field is not mandatory. my code in fielValidation.js: “mail”: { method: function (name, value, personAttributeDetails) { if (value==""){ return document.getElementById(‘phoneNumber’).requared=true; } return document.getElementById(‘mail’).requared=true; }, errorMessage: “REGISTRATION_ERROR_KEY_MAIL_OR_PHONE_NUMBER” } doesn’t work

Hi @maximus

Can you try this?

just try, doesn’t work. feeling, file fildValidation.js does not affect :cold_sweat:

Can you debug on browser and see whats happening around the if condition?

i debug on chrome browser, there check to mail, phone fields passes. I need to when I pressed the button to save, will check if the e-mail field is empty, then field phone is mandatory if the field is almost full, then the Phone becomes optional

who knows? How to solve this problem?

i debug on chrome browser, there check to mail, phone fields passes. I need to when I pressed the button to save, will check if the e-mail field is empty, then field phone is mandatory if the field is almost full, then the Phone becomes optional

Can you take a screenshot and send us.

https://talk.openmrs.org/uploads/default/original/2X/2/2e9c4462e910bdf61ebc9d8645ac072ba6fcf106.png