18590 Posts in 4875 Topics by 2285 members
General Questions
SilverStripe Forums » General Questions » CurrencyField problem
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba
|
Page:
1
|
Go to End | |
| Author | Topic: | 857 Views |
-
CurrencyField problem

3 September 2010 at 12:33pm Last edited: 3 September 2010 12:34pm
Hi,
I'm using Silverstripe 2.4.0 for a project at the moment and I am using a couple of CurrencyFields on a particular page type in the CMS.
Unfortunately I am unable to save the page as I keep getting the following javascript error:
$("Form_EditForm").validateCurrency is not a function
Has anyone else encountered this? and does anyone know of a fix?
-
Re: CurrencyField problem

3 September 2010 at 12:47pm
Additional info:
Currently have recreated this in Firefox 3.6.8 and the most recent version of Chrome on Mac OS X.
It only seems to be a problem when the CMS loads straight to that page (eg. if I click that page in the CMS and then refresh I will get the javascript error). However, if I load the CMS on a different page and then click on the page in question, I get no errors and it saves fine.
-
Re: CurrencyField problem

30 September 2010 at 1:43pm
got the same problem. could u solve it ?
cheers
matze -
Re: CurrencyField problem

24 March 2011 at 9:26am
I have this same issue, seems to be more of a bug than just a problem. Did any of you get this resolved?
cheers
-
Re: CurrencyField problem

11 August 2011 at 2:36pm
To add to this. I have the same problem.
The problem is in:
sapphire\forms\CUrrencyField.phpfunction:
function jsValidation()particuallarly the regex pattern match:
/^\s*(-?\\\$?|\\\$-?)?(\d{1,3}(\,\d{3})*|(\d+))(\.\d{2})?\s*\$/To recreate this problem create a CurrencyField in your page. Select that page in the CMS. Refresh the page in your browser. In the firebug console you will notice the error:
invalid quantifierThen when saving the page the following error occurs:
$("Form_EditForm").validateCurrency is not a functionWhen you change the regex it no longer throws errors (although it no longer correctly validates against what it should).
-
Re: CurrencyField problem

11 August 2011 at 2:53pm
I found changing the regex to the following worked:
/^\s*[\$]?(\d{1,3}(\,\d{3})*|(\d+))(\.\d{2})?\s*\$/
| 857 Views | ||
|
Page:
1
|
Go to Top |


