Validation

In WHMCS, field validation ensures that the data entered by users complies with specific criteria or formats. This helps maintain data integrity and accuracy. WHMCS provides various validation options for custom fields. Here are some of the validation options available:

  1. Required:

    • This validation type makes a field mandatory. Users must provide a value for the field before they can submit the form.
  2. Minimum Length:

    • Specifies the minimum number of characters required for a text input field.
  3. Maximum Length:

    • Specifies the maximum number of characters allowed for a text input field.
  4. Regular Expression:

    • Allows you to define a pattern (regex) that the input must match. This is a powerful tool for validating complex data formats.
  5. Minimum Value:

    • Used for numeric fields, this sets the minimum acceptable value.
  6. Maximum Value:

    • Used for numeric fields, this sets the maximum acceptable value.
  7. Date Range:

    • Sets the range of dates that are acceptable for a date picker field.
  8. Allowed File Extensions:

    • Specifies the types of files that can be uploaded through a file upload field.
  9. Allowed MIME Types:

    • Defines the allowed MIME types for uploaded files.
  10. Allowed File Size:

    • Specifies the maximum file size for uploaded files.
  11. Custom Validation:

    • Allows you to define custom validation rules using PHP code.

By applying these validation options to custom fields, you can ensure that the data collected from users meets your specific criteria. This helps maintain data quality and accuracy in your WHMCS system. When creating custom fields, consider which validation options are appropriate based on the type of information you need to collect.

  • 0 Users Found This Useful
Was this answer helpful?