docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Delegate InputField.OnValidateInput

    Delegate for the onValidateInput callback. Called for each character entered to validate or replace it.

    Namespace: UnityEngine.UI
    Assembly: UnityEngine.UI.dll
    Syntax
    public delegate char InputField.OnValidateInput(string text, int charIndex, char addedChar)
    Parameters
    Type Name Description
    string text

    The current text of the input field, before the new character is added.

    int charIndex

    The index at which the new character is being inserted.

    char addedChar

    The character the user is attempting to add.

    Returns
    Type Description
    char

    The character to insert, or '\0' to reject the input.

    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)