How to Format and Validate a MAC Address in a PDF Form
Question details
The user needs to set up a text field in a PDF form to format input as a MAC address with separators and validate that it only contains valid hexadecimal characters.
- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Creating or editing an interactive PDF form and ensuring users enter correctly formatted network MAC addresses.
- Observed behavior
- The user needs a method to enforce a 12-character hexadecimal format (with hyphens or colons) using either format masks or custom validation scripts.
Ensure you have your PDF opened in form-editing mode (such as 'Prepare Form' in Acrobat) and have access to the Text Field Properties dialog.
Use an Arbitrary Mask for Display Formatting
Set a predefined format mask to automatically insert hyphens as the user types the MAC address.
This is the simplest method to ensure the entered characters are visually separated into the standard MAC address layout. However, it does not restrict the input to strictly hexadecimal characters.
Right-click the target text field in your PDF form and select 'Properties' from the context menu.
Click on the 'Format' tab at the top of the Properties dialog box.
Click the 'Select format category' dropdown menu and choose 'Special'.
Select 'Arbitrary Mask' and enter 'XX-XX-XX-XX-XX-XX' into the mask field. Click 'Close' to save your changes.

Add a JavaScript Validation Script
Use a regular expression script to check for invalid characters and ensure the address is complete.
Manage and Fill PDF Forms Easily with WPS Office
WPS Office includes a comprehensive PDF editor that lets you view, fill, and manage interactive PDF forms seamlessly. Whether you are dealing with text fields, dropdowns, or validated formats, WPS PDF ensures a smooth user experience.
- 1. Install WPS Office: Download and install the free WPS Office suite on your device.
- 2. Open Your PDF: Launch WPS PDF and open the interactive PDF form you need to fill.
- 3. Fill and Save: Click into the text fields to enter your data. The software will respect standard field formatting. Save your completed document securely.

Frequently Asked Questions
Why does my arbitrary mask not stop non-hexadecimal characters?
An arbitrary mask in PDF forms only dictates the structural format (like inserting hyphens). The 'X' placeholder accepts any standard alphanumeric character. To strictly enforce hexadecimal characters (0-9 and A-F), you must add a custom JavaScript validation script.
Can I use colons instead of hyphens for the MAC address format?
Yes. To display colons, change your arbitrary mask in the Format tab to 'XX:XX:XX:XX:XX:XX'. The provided JavaScript regular expression already validates both hyphens and colons as acceptable separators.
Where do I find the text field properties to add these formats?
You need to be in form editing mode. In Acrobat, open the 'Prepare Form' tool, right-click the specific text field you want to modify, and select 'Properties' from the drop-down menu to access the Format and Validate tabs.




