How to Allow Users to Enter a Month and Year in a PDF Form
Question details
The user needs to create a form field in a PDF that accepts only a month and a year (such as 04/2026) without forcing the person filling out the form to select a specific day.

- Product
- PDF Form Editor
- Device & OS
- not provided
- Scenario
- Creating or modifying a fillable PDF form that requires a credit card expiration date, graduation date, or other general month/year inputs.
- Observed behavior
- Standard date fields and date pickers typically require a full DD/MM/YYYY date, making it necessary to configure a custom text field to capture only the month and year.
Ensure you have a PDF editor with form-building capabilities open, and verify that your document is in editing mode.
Configure a Text Field with a Custom Format
Use a standard text field and apply a custom format or validation script to restrict user input to a valid MM/YYYY pattern.
Instead of using a default date field which inherently requires a specific day, you can use a text field configured to accept only two digits for the month and four digits for the year.
Open your PDF form editor, select the Text Field tool from the form controls menu, and drag to create a new field on the document.
Right-click the newly created text field and select 'Properties' to open the configuration menu.
Navigate to the 'Format' tab. Change the format category to 'Date' and type 'mm/yyyy' into the custom format box. If your editor requires a script instead, select 'Custom'.
If using a Custom category, enter a validation script that verifies the first two digits are between 01 and 12, followed by a slash, and ending with a four-digit year.

Use Dropdown Menus as an Alternative
Provide pre-defined selections for the month and year using two separate Dropdown (Combo Box) fields to eliminate formatting errors.
Create and Edit PDF Forms with WPS Office
WPS Office provides robust PDF editing tools, allowing you to easily add text fields, dropdowns, and set custom formatting or validation for form data without needing expensive software.
- 1. Open your PDF: Launch WPS PDF and open the document you want to turn into a fillable form.
- 2. Insert Form Fields: Navigate to the 'Form' tab on the ribbon and select the 'Text Field' or 'Combo Box' tool.
- 3. Customize Properties: Double-click the inserted field to open the Properties panel and apply your custom MM/YYYY formatting.
- 4. Save the Form: Click 'Save' to preserve the interactive fields. The form can now be filled out in any standard PDF reader.

Frequently Asked Questions
Can I use a standard date picker for a month and year only?
Standard PDF date pickers usually default to selecting a specific day. For capturing only a month and year, it is better to use a customized text field or separate dropdown menus.
How do I ensure users enter exactly four digits for the year?
You can enforce this by setting a character limit in the text field properties (limiting the total input to 7 characters for MM/YYYY) and using a custom validation script to check the structure.
Will custom PDF format scripts work on mobile PDF readers?
JavaScript-based custom validation and formatting may not be supported on all mobile PDF readers or browser-based viewers. If mobile compatibility is critical, using separate dropdown fields is highly recommended.




