Required Fields for every Department
Posted by TWendt - Sep 28 ’16 at 03:16
Hi all,
i have six departments. For every department i have a choice field Approved / Not approved, a date field and a people picker field. If the choice field is marked, the other fields should be required. What must i do?
Best wishes
Tom
-
Dmitry KozlovAdminMember for: 9 years 8 months 16 days
Hi Tom,
Please, read the post:
http://formsdesigner.blogspot.com/2014/07/how-to-conditionally-hide-disable-make.html
-
TWendtMemberMember for: 8 years 8 months 29 days
Hi Dmitry,
thanks for the information. But can you give me more information about a choice field with radio buttons 'PME_x002d_Freigabe'?
function setRequiredFields() { if (fd.field('PME_x002d_Freigabe').value().dictionaryEntries.length != 0) { // Add asterisks fd.field('PME_x002d_Datum').titleRequired(true); } else { // Remove asterisks fd.field('PME_x002d_Datum').titleRequired(false); } } Unfortunately it does not work. Best regards Tom
-
YuriyMedvedevModeratorMember for: 6 years 8 months 11 days
[#2]: Hi!
For radio-buttons you have to use just "value()", like in this example. Here, if first radio is choosen "Name"-field is not required, but if you chose other radio - it is required.
function setRequiredFields() {
if (fd.field('Radio').value() != 0) {
fd.field('Name').titleRequired(true); }
else {
fd.field('Name').titleRequired(false); } }
fd.field('Radio').change(function(){
setRequiredFields();
});
setRequiredFields();