> ## Documentation Index
> Fetch the complete documentation index at: https://ziva.zeleza.ru/llms.txt
> Use this file to discover all available pages before exploring further.

# InputTask

> Text input task with validation

# InputTask

`InputTask` provides an interface for text data input with validation support.

## Creating

```go theme={null}
task := ziva.NewInputTask("Username", "Enter name:")
```

<img src="https://mintcdn.com/terem/7tfdR1JkDhuUAiXc/images/pic_4.png?fit=max&auto=format&n=7tfdR1JkDhuUAiXc&q=85&s=730b5c0561aa83a054e11f906d7a49b0" alt="Screenshot: input with validation" width="961" height="556" data-path="images/pic_4.png" />

## Main Methods

```go theme={null}
// Settings
task.WithValidator(ziva.DefaultValidators.Email())  // validator
task.WithInputType(ziva.InputTypePassword)         // field type
task.WithTimeout(30*time.Second, "default")          // timeout
task.WithVisibleLength(20)                         // limit visible width with horizontal scroll

// Get result
value := task.GetValue() // string
```

## Input Types

```go theme={null}
const (
    InputTypeText     = ziva.InputTypeText     // regular text
    InputTypePassword = ziva.InputTypePassword // password (hidden)
    InputTypeEmail    = ziva.InputTypeEmail    // email
    InputTypeNumber   = ziva.InputTypeNumber   // number
    InputTypeIP       = ziva.InputTypeIP       // IP address
    InputTypeDomain   = ziva.InputTypeDomain   // domain
)
```

## Example with Validation

```go theme={null}
v := ziva.DefaultValidators

email := ziva.NewInputTask("Email", "Enter email:").
    WithInputType(ziva.InputTypeEmail).
    WithValidator(v.Email())

password := ziva.NewInputTask("Password", "Enter password:").
    WithInputType(ziva.InputTypePassword).
    WithValidator(v.StrongPassword())

queue := ziva.NewQueue("Registration")
queue.AddTasks(email, password)
queue.Run()

fmt.Printf("Email: %s\n", email.GetValue())
```

## See Also

* [Validation](/en/validation/overview) - detailed validation system
