Questions and discussion about using ProcessMaker: user interface, running cases & functionality
By PipSqueak
#815391
amosbatto wrote: Tue Jun 06, 2017 7:43 pm
endangkusmayadi wrote:I have problem when it applied to textbox in grid, is it possible using jquery.masknumber.js to format number in grid??
Endang, you can use this JavaScript code to set the thousands separator in grid fields:
Code: Select all
var gridId = "orderList"; //set to ID of grid
var fieldId = "amount"; //set to ID of text field inside grid

//set the thousands separator in all existing rows when the DynaForm loads:
var nRows = $("#"+gridId).getNumberRows()
for (var i = 1; i <= nRows; i++) {
  $("[id='form["+gridId+"]["+i+"]["+fieldId+"]']").maskNumber({decimal: ',', thousands: '.'});
}

//set the thousands separator in newly added rows:
$("#"+gridId).onAddRow(function(aNewRow, oGrid, rowIndex) {
  $("[id='form["+gridId+"]["+rowIndex+"]["+fieldId+"]']").maskNumber({decimal: ',', thousands: '.'});
});
Hi Amos,

How do I make the sum function work with the masked numbers in a grid?

Thanks
By Bosatzu
#825061
zainab wrote: Tue Apr 04, 2017 2:59 am Hello,

Could you please export your dynaform's JSON code, in order to better debug your issue. Also when previewing the dynaform, use your browser's Developer tool and open the console log, check what you find in the console log, this might give you an idea what is wrong with your javascript if any. Also kindly attach the screenshot here if possible.

Is there any other javascript in your dynaform? Check if that is causing any error.

Looking forward to your response.

Best Regards,
Zainab Sabunwala
Hi! can you help me out? i have this problem: viewtopic.php?f=41&t=736854&p=825048#p825048
By Acroporax
#831281
amosbatto wrote: Wed Apr 05, 2017 8:28 pm The problem is that you are using a variable for your textbox which is float type. You need to change your variable type to string.
You can create a hidden field that uses the float variable. Then use JavaScript to copy between the two fields. For example, if the visible field has an ID of myString and the hidden field has an ID of myFloat:
Code: Select all
$("#myString").setOnchange( function(newVal, oldVal) {
  newVal = newVal.replace(",", "");
  $("#myFloat").setValue(newVal);
});
//copy value from hidden field to visible field when form loads:
var val = $("#myFloat").getValue();
val = val.replace(/\B(?=(?=\d*\.)(\d{3})+(?!\d))/g, '_'); 
$("#myString").setValue(val); 
When i write to mystring 1250000.00 then i get error

Image

A Dream11 clone script is a pre-made software solu[…]

A stake clone script is a pre-designed, error-free[…]

The Aviator casino game script clone script replic[…]

The ZED RUN Clone Script by Dappsfirm replicates t[…]