5 Replies Latest reply on Apr 23, 2008 10:05 AM by (Craig_Caughlin)

    What wrong with my "format a field as a percentage" javascript?

      Hi folks,

      I'm new to creating forms with Acrobat, and I'm trying to format a text field as a percentage.

      I have a few questions:

      1.) Do I want to add my javascript as a javascript under the "Action" tab or as a validation script under the "Validation" tab?

      2.) If I add this as an "Action", what do I use as a "trigger"?

      3.) Here's my script which doesn't work:

      var percentage = this.getField("Principal_1_Ownership").value;
      if (percentage < "101") { Principal_1_Ownership.value = Principal_1_Ownership.value + "%"; }

      else {
      Principal_1_Ownership.value = Principal_1_Ownership.value * .10 + "%";

      Can someone tell me what I'm doing wrong? Comments? Suggestions?

      Thank you.