Skip to content

Conversation

@dmzoneill
Copy link

Summary

  • Fixes Quick Create extension input field to properly handle extensions with leading zeros
  • Changes input type from 'number' to 'text' with pattern validation

Problem

HTML <input type="number"> strips leading zeros from values. For example, if a user enters "0123", the browser will display and submit "123". This is problematic for phone extensions that legitimately start with zero.

Solution

Changed the extension input field to:

  • type="text" - Preserves leading zeros as entered
  • pattern="[0-9]*" - Ensures only numeric input is accepted
  • Maintains all existing validation and functionality

Changes

  • Modified /views/quickCreate.php line 56
  • Input type: numbertext
  • Added pattern="[0-9]*" attribute

Testing

  • Extensions with leading zeros (e.g., "0123") are now properly preserved
  • Non-numeric input is rejected by the pattern attribute
  • Existing validation still works correctly
  • Applies to both FreePBX 16 and 17

Fixes #123

…eros

Changed extension input field type from 'number' to 'text' with pattern
validation to preserve leading zeros. HTML number inputs strip leading
zeros (e.g., "0123" becomes "123"), which causes issues for extensions
that start with zero.

The pattern="[0-9]*" attribute ensures only digits can be entered while
allowing extensions with leading zeros to be properly displayed and stored.

Fixes FreePBX#123
@sangoma-oss-cla
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@dmzoneill
Copy link
Author

Thank you for the CLA reminder. I'll review and sign the Contributor License Agreement to move this PR forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant