Questions and discussion about using ProcessMaker: user interface, running cases & functionality
#827570
Hi, I need help to fix my function. this is used in number only textbox which is autoformat to "x year/years"
Code: Select all
function formatInYears(FieldID, newVal, oldVal){
  console.log(FieldID); //instead of fieldID, this return new Value of id
 //I want to add suffix FieldID_label to x years (it's mean real data only contains number, but show as x year/years)
}

$('#document').ready(function() {
	//mandatoryPoA();
  	mandatoryConfOthers();
  	informedlabel();
  	$('#durationNDA').setOnchange(formatInYears); //I want to make formatInYears function reusable to another field
});
any advice?
#827608
Use lib: https://igorescobar.github.io/jQuery-Mask-Plugin/docs.html
Step 1: Copy lib jquery.mask.js to: /opt/processmaker/workflow/public_html/assets/js
Step2: Add external libs in dynaform: /assets/js/jquery.mask.js
Step 3: Add script in Dynaform
Code: Select all
$('#test').getControl().mask('#.##0 year/years',  {reverse: true});
$("#btnSave").on("click", function() {
    $('#test').getControl().unmask();
});
$('#' + frames.dyn_uid).setOnSubmit(function () {
    $('#test').getControl().unmask();
});
#827686
Hi,
You can change your code to like this code:
Code: Select all
function formatInYears(FieldID, newVal, oldVal){
  console.log(FieldID); //instead of fieldID, this return new Value of id
 //I want to add suffix FieldID_label to x years (it's mean real data only contains number, but show as x year/years)
}

$('#document').ready(function() {
	//mandatoryPoA();
  	mandatoryConfOthers();
  	informedlabel();
  	$('#durationNDA').setOnchange(function(newValue, oldValue){
		formatInYears(FieldID, newValue, oldValue);
	}); //I want to make formatInYears function reusable to another field
});
https://pmlearning.info
Thanks

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[…]