Questions and discussion about using ProcessMaker 2: user interface, running cases and functionality

Moderator: ArturoRobles

Forum rules: Please search to see if a question has already been asked before posting. Please don't ask the same question in multiple forums.
#43008
Hello everyone,
I'm trying to convert numbers to words for each row in a grid using an After Trigger:
For the first row, everything works fine.
Upon adding a new row, only the last row is converted but its output goes into the first row. What am I doing wrong? Please take a look:
(I have now attached the file i'm working with)
Attachments
(31.9 KiB) Downloaded 59 times
Last edited by pmzwema on Wed Feb 13, 2013 6:40 am, edited 1 time in total.
#43897
//I'm looking to making the trigger work like this:

foreach (@=PM_GRID_TANKER_TRUCK as $row)
{
$num = $row['PM_COMPARTMENT_CAPACITY'];
}
//output:
$row['PM_CAPACITY_WORDS'] = convertNumber($num);

the ideal output would be for each row to produce its own capacity in words. Please help, I'm stuck (with little knowledge in php functions).
By MALIKI
#828548
i create two input in the dynafom and assign the following variable @totalPlace_amount --- this variable represent the amount in fiqured . @amount_in_words------this variable represent the fiqure in words . i want if someone enter the amount in the figured input , should automatically get the values in words.
But this Javascripts is not working out for me


function inWords (num) {

var a = ['','one ','two ','three ','four ', 'five ','six ','seven ','eight ','nine ','ten ','eleven ','twelve ','thirteen ','fourteen ','fifteen ','sixteen ','seventeen ','eighteen ','nineteen '];
var b = ['', '', 'twenty','thirty','forty','fifty', 'sixty','seventy','eighty','ninety'];

if ((num = num.toString()).length > 9) return 'overflow';
n = ('000000000' + num).substr(-9).match(/^(\d{2})(\d{2})(\d{2})(\d{1})(\d{2})$/);
if (!n) return; var str = '';
str += (n[1] != 0) ? (a[Number(n[1])] || b[n[1][0]] + ' ' + a[n[1][1]]) + 'crore ' : '';
str += (n[2] != 0) ? (a[Number(n[2])] || b[n[2][0]] + ' ' + a[n[2][1]]) + 'lakh ' : '';
str += (n[3] != 0) ? (a[Number(n[3])] || b[n[3][0]] + ' ' + a[n[3][1]]) + 'thousand ' : '';
str += (n[4] != 0) ? (a[Number(n[4])] || b[n[4][0]] + ' ' + a[n[4][1]]) + 'hundred ' : '';
str += (n[5] != 0) ? ((str != '') ? 'and ' : '') + (a[Number(n[5])] || b[n[5][0]] + ' ' + a[n[5][1]]) + 'Dollar ' : '';
return str;
}
$("#totalPlace_amount").onkeyup = function () {
$("#amount_in_words").setValue()= inWords($("#totalPlace_amount").getValue());
};

Excellent read, Positive site, where did u come up[…]

Hello ProcessMakers! We are extremely proud to an[…]

How processmaker load cases on home page of user? […]

Hey everyone, I'd appreciate any help you might be[…]