Hello all,
I am working on a form which needs some currency input (Euros in my case). In Germany it is standard to write 24,00 for a full twenty-four Euros.
I have checked an older post from December 2008 where it was suggested to use
/^\-?([1-9]{1}[0-9]{0,2}([., ][0-9]{3})*([.,][0-9]{0,2})?|[1-9]{1}\d*([, ][0-9]{0,2})?|0([.,][0-9]{0,2})?|([.,][0-9]{1,2})?) ?[$£€€]?$/
as regex string in 'components/com_chronocontact/js/validation.js'.
First of all, I do not have that file. Instead I only have 'components/com_chronocontact/js/jsvalidation2.js". When I tried to use the string, no validation worked. Then I added a comma to the end of the string, as I had seen that somewhere else. The validation for the other fields worked then, but not the currency.
My code in the mentioned file looks like this:
My questions now are this:
Do I have to add a parameter in the validation tab of the backend?
Has there been a major update in Chronoforms since that above mentioned post in 2008 and the string or location of the string has changed?
I am pretty sure I only need a minor change, but currently I seem to be looking for the needle in the heystack.
Any help?
Thanks to everybody.
kazpad
I am working on a form which needs some currency input (Euros in my case). In Germany it is standard to write 24,00 for a full twenty-four Euros.
I have checked an older post from December 2008 where it was suggested to use
/^\-?([1-9]{1}[0-9]{0,2}([., ][0-9]{3})*([.,][0-9]{0,2})?|[1-9]{1}\d*([, ][0-9]{0,2})?|0([.,][0-9]{0,2})?|([.,][0-9]{1,2})?) ?[$£€€]?$/
as regex string in 'components/com_chronocontact/js/validation.js'.
First of all, I do not have that file. Instead I only have 'components/com_chronocontact/js/jsvalidation2.js". When I tried to use the string, no validation worked. Then I added a comma to the end of the string, as I had seen that somewhere else. The validation for the other fields worked then, but not the currency.
My code in the mentioned file looks like this:
if(field.hasClass('validate-currency-dollar')){
if( tmessage) { var message_validate_currency_dollar = tmessage; }
name.add( Validate.Format, {
pattern: /^\-?([1-9]{1}[0-9]{0,2}([., ][0-9]{3})*([.,][0-9]{0,2})?|[1-9]{1}\d*([, ][0-9]{0,2})?|0([.,][0-9]{0,2})?|([.,][0-9]{1,2})?) ?[$£€€]?$/,
failureMessage: message_validate_currency_dollar
});
My questions now are this:
Do I have to add a parameter in the validation tab of the backend?
Has there been a major update in Chronoforms since that above mentioned post in 2008 and the string or location of the string has changed?
I am pretty sure I only need a minor change, but currently I seem to be looking for the needle in the heystack.
Any help?
Thanks to everybody.
kazpad