How to Add Feet and Inches Symbols to a PDF Form Field
Question details
The user wants to format a PDF form field so that entering a whole number automatically appends feet and inches symbols (for example, converting '30' into '30\' 0"').

- Product
- PDF Editor
- Device & OS
- not provided
- Scenario
- Designing a custom PDF form that requires specific measurement formatting to standardize user input.
- Observed behavior
- The form field needs to display formatted text with measurement symbols without requiring the user to type the symbols manually.
Determine whether you need a single field for whole numbers (e.g., exactly 30 feet) or if users will need to enter mixed fractional measurements like 30' 6", as this will determine the complexity of the script needed.
Apply a Custom Format Script to the Form Field
Use JavaScript in the field's formatting properties to automatically append the feet and inches symbols when a user enters a number.
This method is ideal if users are only entering whole feet values and you want to automatically append the ' 0" suffix to the display.
Open your PDF in your PDF editor and enter the Form Editing or Prepare Form mode.
Right-click the target text field where users will input the measurement and select Properties.
Navigate to the Format tab. From the 'Select format category' drop-down menu, choose 'Custom'.
In the Custom Format Script window, enter the following code exactly: if (event.value) event.value += "' 0\"";
Click OK or Close to save the properties. Exit form editing mode and type a number like 30 into the field to see it change to 30' 0".

Use Separate Form Fields for Feet and Inches
Create distinct input boxes for feet and inches to handle complex or fractional measurements easily without requiring complex scripting.
Manage PDF Form Fields with WPS Office
WPS PDF provides robust tools for creating interactive PDF forms, adding text fields, and customizing properties, making it easy to gather structured measurement data.
- 1. Open your PDF: Launch WPS Office and open your PDF document in the PDF viewer.
- 2. Access form tools: Navigate to the Form tab on the top ribbon to access all form creation tools.
- 3. Insert text fields: Click 'Text Field' and draw the input box on your document where the measurements will go.
- 4. Adjust properties: Double-click the newly created field to open its properties and adjust the formatting or validation settings.

Frequently Asked Questions
Can I format the field to accept decimal inputs for inches?
Yes, but it requires a more advanced custom keystroke or formatting script using JavaScript to convert decimal inputs (like 30.5) into proper feet and inches formats (like 30' 6"). For simplicity, using separate fields is generally recommended for complex inputs.
Why doesn't my custom format script work when I export the form data?
Format scripts only alter the visual display of the field. If you export the form data to a spreadsheet, it will export the raw value the user entered (e.g., 30) rather than the formatted string (30' 0").
Do JavaScript formatting scripts work on mobile PDF readers?
Many mobile PDF viewers have limited or no support for JavaScript. Custom formatting scripts may not execute properly on smartphones or tablets, so testing on your target platforms is highly recommended.




