Hi
unfortunately it doesn't work for me.
I tried to strictly follow your instructions as follows:
I downloaded in the path
plugins/jquerymaskmoney/ the Jquery-maskMoney plugin
In the Before Display event I inserted
$html = <<<EOT
<script src="/plugins/jquerymaskmoney/dist/jquery.maskMoney.min.js" type="text/javascript"></script>
EOT;
echo $html;
and in the Javascript Onload event I inserted the following lines
$('input[id^="costonetto"]').maskMoney({thousands:'.', decimal:',', allowZero:true, suffix:' €', precision: 2});
$('input[id^="pricenet"]').maskMoney({thousands:'.', decimal:',', allowZero:true, suffix:' €', affixesStay: true});
$('input[id^="listino2"]').maskMoney({prefix:'R$ ', allowNegative: true, thousands:'.', decimal:',', affixesStay: true});
$('input[id^="listino3"]').maskMoney({prefix:'R$ ', allowNegative: true, thousands:'.', decimal:',', affixesStay: true});
this.on('beforeSave', function(formObj, fieldControlsArr, pageObj){
$('input[id^="costonetto"]').val($('input[id^="costonetto"]').maskMoney('unmasked')[0]);
$('input[id^="pricenet"]').val($('input[id^="pricenet"]').maskMoney('unmasked')[0]);
$('input[id^="listino2"]').val($('input[id^="listino2"]').maskMoney('unmasked')[0]);
$('input[id^="listino3"]').val($('input[id^="listino3"]').maskMoney('unmasked')[0]);
});
In the code of the page I inserted, in the <head> section
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"></script>
<script src="jquery.maskMoney.js" type="text/javascript"></script>
What am I doing wrong? What am I leaving out? And where?
Thanks if you can help me.