Elzo Forms logo
  • Home
  • PRO
  • Docs
Account
Buy Now
Documentation / Developer Guide

Custom Validation and Empty Values

Use validation filters when built-in field settings are not enough for a project-specific rule.

Control empty value detection

add_filter('elzo_forms_is_field_value_empty', function ($is_empty, $value, $field, $form) {
    if (is_string($value) && trim($value) === '0') {
        return false;
    }
    return $is_empty;
}, 10, 4);

Best practice

Always validate on the server. JavaScript validation improves user experience but should not be treated as security.

On this page

Control empty value detection Best practice

Documentation

All documentation

User Guide

Developer Guide

Developer Overview Rendering Forms with Shortcodes and PHP Template Overrides PHP Hooks and Filters Reference Submission Lifecycle Hooks Custom Validation and Empty Values Email Customization Hooks Field Type Filters Build a Custom Field Field API Reference Module Development JavaScript Hooks and Events API Admin JavaScript Events Automation Developer Overview Custom Automation Actions Custom Automation Conditions Automation Lifecycle Hooks Automation Merge Tags Automation Logs for Developers Webhook Integrations for Developers Developer Security Best Practices

Related docs

Submission Lifecycle Hooks Submissions Screen Email Customization Hooks PHP Hooks and Filters Reference Field Type Filters

Help resources

Documentation home Community support
Elzo Forms logo
Elzo Forms is a WordPress Form plugin with free and PRO versions. It is a powerful tool for creating forms and managing submissions.
  • Elzo Forms
    • PRO
    • Pricing
  • Help
    • Docs
  • Account
    • Login
  • Privacy
  • Terms
  • Refunds
  • License Terms
  • Payment
  • Contact
© 2026 Elzo Forms. All rights reserved.
 
  • Home
  • PRO
  • Docs
Contact us