Hi
I've a form that has a currency field that allows user to select the currency that the figures that are entered since not all currency symbols are $ example, euro, british pound or Yen.
I would like to display the currency symbol that the user has selected in all number fields that are formatted as currency.
May I know how this could be acheived?
Thanks.
Henry
To do this in real time while the user is entering data requires custom jQuery. This is one way of doing it: https://formidable-masterminds.com/formatting-fields-as-currency/. You'll have to figure out how to use the library to get the different symbols. Another way is to use the built-in JavaScript Intl.NumberFormat object. See this: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat
Hi thanks for your help. It seems using built-in Javascript Intl.NumberFormat is a possible solution. However, can you show how update the currency of a number field based when the user changes the currency field selection. E.g. user changed the "Currency" field from "USD" to "EURO" and the price field will be changed to 1.000 Euro instead of $1,000.
Hope it is not too much of an ask. Thanks.
Please login or Register to submit your answer