Questions and discussion about using ProcessMaker: user interface, running cases & functionality
#826966
Dear All
I want to create a dynaform. But the dynaform should show different buttons depending on the days of a leave request. For example, if this is a 1-day leave request, it should show "approve" in the supervisor. However if this leave is 3 or more days, then it should show "Agree" in the "supervisor" and request then be sent to the manager and show "Approve" button. How can I do this? Should I write a trigger ?
#826993
Hi,

You can use two way javascript or trigger
For example with trigger you can do like this:
Code: Select all
//PHP CODE
@@hidden_js = '';
if(@@remain == 1){
	@@hidden_js .= '
		$("#button_1").hide();
	';
}
else if(@@remain == 2){
	@@hidden_js .= '
		$("#button_2").hide();
	';
}
else if(@@remain == 3){
	@@hidden_js .= '
		$("#button_3").hide();
	';
}
Now you must create a hidden field in your dynaform with "hidden_js" name and with the bellow javascript code:
Code: Select all
$("document").ready( function(){
	if($('#hidden_js').getValue() != '')
		eval($('#hidden_js').getValue());
});
https://pmlearning.info
Thanks
Last edited by programerboy on Wed Apr 07, 2021 1:40 am, edited 1 time in total.

A 1xbet clone script is a pre-designed software so[…]

4rabet clone script is enabling entrepreneurs to e[…]

Parimatch clone script is enabling entrepreneurs t[…]

In the world of cryptocurrency, a wallet is an app[…]