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 3905 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

Being the best in the started business is the obje[…]

Winzo is a popular and unique game on the mobile p[…]

Cannot create process using templets

Real details. The problem was solved by effect!

However, it is essential to use it responsibly and[…]