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

Try the CloudMigration PST Converter to convert […]

In the rapidly evolving world of online sports be[…]

STEPN integrates social networking and games that […]

Cenforce 150 is a medication used to cope with a c[…]