Ask questions about installing and configuring ProcessMaker 3
By Artonbajrami
#813119
Hi Team,
Im creating the Danyform i want to make it so when user picks Student on the dropdown list, the Student Start Date and Student End Date to be Required
and the Student Start Date to be Before the Student End Date

Thank you
emp.PNG
emp.PNG (6.85 KiB) Viewed 3887 times
User avatar
By amosbatto
#813121
In the properties of studentStartDate and studentEndDate, mark the "required" property. Then add the following JavaScript to your dynaform:
Code: Select all
//changes studentStartDate and studentEndDate to required or not required depending on employeeStatus
function changeRequiredDates(employeeStatus, oldVal) {
   if (employeeStatus == 'student') {
       $("#studentStartDate").enableValidation();
       $("#studentEndDate").enableValidation();
   }
   else {
       $("#studentStartDate").disableValidation();
       $("#studentEndDate").disableValidation();
   }
}
changeRequiredDates($("#studentStatus").getValue(), '');  //when Dynaform loads

$("#studentStatus").setOnchange(changeRequiredDates);
 

You will have the change the IDs to match those used in your DynaForm. See:
http://wiki.processmaker.com/3.1/JavaSc ... Validation
http://wiki.processmaker.com/3.1/JavaSc ... etOnchange
What's SAP FICO?

Embarking on a dissertation can be one of the most[…]

Hello. For rental housing, there are software solu[…]

Experience heightened pleasure with Cenforce 100 M[…]

Get an instant solution to move emails to MBOX for[…]