I am trying to achieve this
If a text field A is <> 0 or text field B <> 0 then
text area is mandatory
else text area is optional.
I can't see a way of conditionally setting a field as required so I have a custom rule in the validation which I think has to be JavaScript?
It's been a log time since I did any JS so please forgive my ignorance.
This doesn't work😟
if if (document.forms['TestNotProcessedAppropriately'].value !=0){
document.getElementById("IncidentDetails").required = true;
}
if if (document.forms['NumberOfIncidentsReported'].value !=0){
document.getElementById("IncidentDetails").required = true;
}
What is the correct syntax for doing this with Chronoforms please?
If a text field A is <> 0 or text field B <> 0 then
text area is mandatory
else text area is optional.
I can't see a way of conditionally setting a field as required so I have a custom rule in the validation which I think has to be JavaScript?
It's been a log time since I did any JS so please forgive my ignorance.
This doesn't work😟
if if (document.forms['TestNotProcessedAppropriately'].value !=0){
document.getElementById("IncidentDetails").required = true;
}
if if (document.forms['NumberOfIncidentsReported'].value !=0){
document.getElementById("IncidentDetails").required = true;
}
What is the correct syntax for doing this with Chronoforms please?
you can do this with field events behavior, in your target field, make it required and disabled, then in the events behavior add the following rule:
field A <> 0
field B <> 0
field A <> 0
field B <> 0
You need to login to be able to post a reply.