Skip to main content
yanksgirl
Inspiring
September 24, 2026
Answered

Remove percent sign from end of mapped field

Good afternoon,

I have a form I’m building that brings mapped fields from our Core system into the PDF.  One of those fields is an interest rate (AP_1_INTEREST_RATE).  This field comes in from the core as the number and a % sign, i.e. 1.99%.  That would be great, however, the line on the PDF that it is populating on has a static % sign already, so on the form it looks like 1.99%%.  I cannot for the life of me figure out how to strip the % from the mapped field (AP_1_INTEREST_RATE).  I also have the field format as NONE so it isn’t gaining the % because of the way I have it formatted, it’s coming from the core that way.  

 

Sorry if this is a dumb question but I am a novice and just can’t figure this out. I know how to ADD things but can’t figure out how to remove them.   Any help would be appreciated!

    Anand Sri Bhattacharya
    Community Manager
    September 24, 2026

    @yanksgirl thanks for confirming the details.

     

    When a value is pushed into a field by an import or by an external system (your Core), Acrobat does not fire the same field events it fires when someone types and tabs out. So the Validate event and the Calculate event cannot be relied on to run on a Core-populated value. A validation or calculation script is not the tool for this.

     

    Because the value only needs to look right on the rendered line and is not used anywhere else, the cleanest fix is a Custom Format script. A Format script changes only what is displayed, not the stored value, which is exactly what you want here. Your Core keeps sending "1.99%", the field still stores "1.99%", but it draws "1.99", and your static "%" then reads correctly as "1.99%". No extra calculated field needed.

     

    Steps in Acrobat Pro:

    1. Open All tools > Prepare a form.
    2. Right-click AP_1_INTEREST_RATE and select Properties.
    3. Open the Format tab.
    4. Select Custom, then Custom Format Script.
    5. Enter this one line:
    6.    event.value = String(event.value).replace(/%$/, "");
    7. Click OK/Close and save. 

     

    This strips only a "%" at the end of the displayed value:

    • Core sends 1.99%
    • Field displays 1.99
    • Your existing static % remains
    • Final appearance: 1.99%

    I would also leave the field's Percentage formatting off, since the "%" is already supplied by your form layout.

     

    Why Format rather than Validate or Calculate: Validate will not reliably run on your imported value (yanksgirl's point, and it is correct), and a Calculation script on this same field would set the field's own value on recalc and fight with what your Core writes in, and it does not fire reliably on import either. The Format event governs the displayed appearance, so it is the right place to hide the extra "%".

     

    Please note that a Format script only redraws when Acrobat regenerates the field's appearance. If the Core populates the field and the file is then opened in Acrobat or Reader, the display should regenerate and you will see "1.99". But if your import path renders or flattens the PDF without Acrobat regenerating appearances, the Format script may not run. If that turns out to be the case, the most robust fix is to strip the "%" at the Core/data-mapping layer so the field simply arrives as "1.99". As an in-document stopgap when the file is opened in Acrobat/Reader, you can force a redraw with a document-level this.calculateNow();, but cleaning it at the Core source is the dependable, viewer-independent answer.

     

    I hope this helps.

    Regards,

    Anand Sri.

     

    6 replies

    Anand Sri Bhattacharya
    Community Manager
    Community Manager
    September 24, 2026

    Hello @yanksgirl,


    I hope you are doing well, and thanks for reaching out and sharing the details. Sorry for the trouble you had.


    Could you please share more details about the workflow/issue?


    1. Which Acrobat product is being used: Acrobat Pro, Acrobat Standard, or Acrobat Reader?

    2. Is the form an AcroForm PDF created with Prepare a form, and is AP_1_INTEREST_RATE it a standard text field?

    3. Is the mapped value populated by JavaScript, an external/core-system integration, or imported form data?

    4. Which platform is affected: Windows or macOS, and what exact Acrobat version/build is installed? Check from Menu > Help > About Adobe Acrobat.


    The key thing you have already worked out is correct: your field format is None, so Acrobat is not adding the "%". The value is arriving from your Core system as the literal text "1.99%", and because your form line already prints a static "%", you end up with "1.99%%". So the goal is to remove the "%" character that is baked into the incoming value.


    Assuming this is a form authored in Acrobat (an AcroForm) rather than LiveCycle/XFA, here is the way to do it.

    To strip the "%" from the value:

    1. Open the form in Prepare Form mode and double-click the AP_1_INTEREST_RATE field to open its Properties.

    2. Go to the Validate tab.

    3. Select Run custom validation script and click Edit.

    4. Enter this single line, then click OK and Close:

    5. event.value = event.value.replace(/%/g, "");


    Please note that this is a sample script. You may need to edit or modify it according to your requirements, system environment, and app version.


    This removes every "%" from the field value, so "1.99%" becomes "1.99", and with your pre-printed static "%", the line then reads "1.99%" as intended. A Validate script is the right place because it changes the committed value of the field. A Custom Format script would only change the on-screen appearance and leave the underlying value untouched, which matters if the value is used anywhere else. For more details, please refer to these articles:

    https://adobe.ly/4hkzHBf

    https://adobe.ly/4dyxUYc


    If you only want to change what is shown and keep the raw value intact, you would instead use Format tab > Custom > Custom Format Script with the same line, but for your case, Validate is usually what you want.

    One thing to check: a Validate script runs when Acrobat processes the field value change. If your Core system pushes data into the field through an import or mapping process that does not trigger the field's events, the script may not fire on its own. If that turns out to be the case, the cleaner fix is to strip the "%" at the mapping/import step, or to handle it with a calculation script instead.


    I hope this helps, and let us know how it goes. Please reach out if you have any questions or need any assistance.


    Regards,

    Anand Sri.

    Translate
    yanksgirl
    yanksgirlAuthor
    Inspiring
    September 24, 2026

    Hi Anand!

    I am using Adobe Pro.  Correct, the field is coming over from our core as 1.99%.  The form also has static text (that I can’t remove) of % so it is populating as 1.99%%.  I was attempting to use a slice calculation script to remove the % but can’t figure out how.  

    Translate
    yanksgirl
    yanksgirlAuthor
    Inspiring
    September 24, 2026

    Also, the value isn’t used anywhere else so a validation script might not be best because I don’t think the population by the core would trigger it?

    Translate