These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

refresh contents of text field based on combo box

kmay
Registered: Mar 18 2010
Posts: 18
Answered

Hi

I have a text field "UNIT PRICE" - it is formatted to display a different currency based on the currency selected in combo box "Currency".

When a value is already entered in UNIT PRICE and the user realises they picked the wrong currency and changes it, the format of UNIT PRICE does not change (eg if £ was selected, then $ picked instead - the format remains £XX.XX...)

if (this.getField("Currency").value == "USD $" ){ 
AFNumber_Format(2, 0, 0, 0,"$", true)};
 
if (this.getField("Currency").value == "GBP £" ){ 
AFNumber_Format(2, 0, 0, 0,"£", true)};
 
if (this.getField("Currency").value == "EUR €" ){ 
AFNumber_Format(2, 0, 0, 0,"€", true)};
 
 
 
if(event.value == "$0.00") event.value = '';
if(event.value == "£0.00") event.value = '';
if(event.value == "€0.00") event.value = '';

Is there a way to make UNIT PRICE refresh when "Currency" is changed? (I have the same code on another field 'TOTAL PRICE' which, I assume, because of the calculation it performs, it refreshes itself every time I change the combobox option)

Thanks!

PS I'm quite sure this is far from the simplest way to have written this code, forgive my newbie-ness

My Product Information:
Acrobat Pro Extended 9.0, Windows
kmay
Registered: Mar 18 2010
Posts: 18
oh I think I've figured this out myself - I moved the code from the Format section to the Custom Calculation section and now it's working :)