StagesDocumentation
GitHub
  • Introduction
  • Architecture
  • Installation
    • Basics
    • Configs
    • Render
    • Data
    • Actions
    • Validation
    • Collections
    • Groups
    • Fieldsets
    • Computed Values
    • Filtered Values
    • Async Data
    • Interface State
    • Custom Errors
    • Dynamic Fields
    • Dynamic and Computed Options
    • Undo / Redo
    • Form Recursion
    • Typecasting
    • Autosave
    • Basics
    • Field Sets
    • A Field Component
    • Default Validation
    • Mapping
    • Basics
    • Stages
    • Render
    • Routing
    • Navigation
    • Dynamic Steps
    • Step Summaries
    • Debugging
  • Internationalization (i18n)
  • Introduction
  • Architecture
  • Installation
    • Basics
    • Configs
    • Render
    • Data
    • Actions
    • Validation
    • Collections
    • Groups
    • Fieldsets
    • Computed Values
    • Filtered Values
    • Async Data
    • Interface State
    • Custom Errors
    • Dynamic Fields
    • Dynamic and Computed Options
    • Undo / Redo
    • Form Recursion
    • Typecasting
    • Autosave
    • Basics
    • Field Sets
    • A Field Component
    • Default Validation
    • Mapping
    • Basics
    • Stages
    • Render
    • Routing
    • Navigation
    • Dynamic Steps
    • Step Summaries
    • Debugging
  • Internationalization (i18n)

Filtered Values

Sometimes it's useful to limit user inputs to certain characters or formats. This can be achieved with the filter property like this:

{
    id: "onlyNumbers",
    label: "Only positive integers allowed",
    type: "text",
    filter: value => value.replace(/\D/g, '')
}

Here's an example with floats:

{
    id: "onlyNumbers",
    label: "Only positive floats allowed",
    type: "text",
    filter: value => value.replace(/[^0-9.]/g, '')
}

Related Demo

Computed Values
Async Data
© Fredi Bach, Unic AG.