• Resolved rahuls17

    (@rahuls17)


    Hello

    I am facing the issue with validation for “Input mask” field type.

    Step 1: Set input mask field and set Mask Input is (###) ###-####
    Step 2: Submit the form like (987 or any thing else. validation not trigger as per mast input.

    Admin Screenshot: https://prnt.sc/dsKdIB8jyFM2
    Front Screenshot: https://prnt.sc/8lEpeLP1Jwr7

    please check the issue and share solution. once it solved happy to rate plugin.

    Thanks!

Viewing 1 replies (of 1 total)
  • Plugin Support Amimul Ihsan

    (@amimulihsanmahdi)

    Hello @rahuls17,

    The behavior you are seeing is expected. The “Input Mask” option is a front-end tool designed to help guide users by formatting their input as they type. However, it does not perform server-side validation to enforce that format upon submission.

    To add strict validation and ensure the input perfectly matches your required format, you need to use a custom validation filter. I have added the filter hook below so that you can customize it as per your requirement.

    add_filter('fluentform/validate_input_item_input_text', function($validation, $field, $formData, $fields, $form) {

    // Do your stuff here



    return $validation;
    }, 10, 5);

    Inside the filter hook, you can write your own validation rules. For more filter hooks, you can follow the developer documentation here.

    Thank you

Viewing 1 replies (of 1 total)

The topic ‘Mask Input field validation not working’ is closed to new replies.