I am constructing a packing slip form with simple calculations, Quantity x Unit = SubTotal, but i need the calculation and the currency symbol to change depending on which radio box is chosen, USD or Yen (USD has decimal point where as the Yen does not).
Is there a simple javascript?
I use Acrobat9 pro
Sure. You have to create a document-level JavaScript and add to it a function like the following:
function dollar_yenFormat() {
// Get the value of the radio button
var curr = getField("currency").value;
// Determine the number of decimal places
var nd = curr === "Yen" ? 0 : 2;
// Determine the currency symbol
var cs = curr === "Yen" ? "\u00a5" : "\u0024";
// Set the format options
AFNumber_Format(nd, 0, 0, 0, cs, true);
}
Replace "currency" with the actual name of the radio button group, and set the export value (Radio Button Choice) to "Yen" for the Yen radio button.
Now you can set the custom Format script for the SubTotal field to the following:
// Custom Format script for SubTotal field
dollar_yenFormat();
You can do the same for the grand total field or any other that need this.
North America
Europe, Middle East and Africa
Asia Pacific