Another techie post, sorry!
So you select a currency, by name, from a drop down list. The software then sends out an AJAX request to our server, the server looks up the currency in our database and automatically fills in text boxes with the name, symbol and exchange rate of that currency. You can then overwrite the content of those boxes if you want to.
Google was no help whatsoever so we were left to our own devices.
We finally found a workaround that works for us, so I thought I’d detail it here in the hope it helps some other poor soul.
Our pages already have a .js file that’s included on virtually all of them. So we added a line to this to set up a variable: var symbol_euro=’€’;.
In our database with the currencies, we added a new field called “JSVariable”.
In our AJAX that gets the symbol, we also retrieve the contents of the JSVariable field.
If JSVariable is empty, then we proceed as normal. But if it does contain anything then instead of setting the text box to contain the raw symbol as per the database, we instead set it to the variable.
So instead of document.getElementById(‘curSymbol’).value=’€’;, our code would return document.getElementById(‘curSymbol’).value= symbol_euro; for the Euro symbol.
I hope that makes sense and I hope it saves someone some time.