Mostly a copy of the demo from this repo that I set up to have a common place to style all the input elements used throughout the site.

Apr. 2021 Update: Complex form inputs (arrays, multi-input)


Doesn't meet regex /^[A-K][a-z]+$/.
ex "Cat" or "Dog" but not "cat"
Required field
            {
  "__v": 1,
  "name": "firstName",
  "error": 7,
  "isTouched": false,
  "isChanged": false,
  "isDisabled": false,
  "value": "krillin",
  "startValue": "krillin",
  "startDisabled": false
}
        
            {
  "__v": 1,
  "name": "lastName",
  "error": 0,
  "isTouched": false,
  "isChanged": false,
  "isDisabled": false,
  "value": "???",
  "startValue": "???",
  "startDisabled": false
}
        

Checkbox1 is a required field
            {
  "__v": 1,
  "name": "checkbox1",
  "error": 0,
  "isTouched": false,
  "isChanged": false,
  "isDisabled": true,
  "value": true,
  "startValue": true,
  "startDisabled": true
}
        

Must be between -2 and 10001
            {
  "__v": 1,
  "name": "email",
  "error": 0,
  "isTouched": false,
  "isChanged": false,
  "isDisabled": false,
  "value": "[email protected]",
  "startValue": "[email protected]",
  "startDisabled": false
}
        
            {
  "__v": 1,
  "name": "numeric",
  "error": 0,
  "isTouched": false,
  "isChanged": false,
  "isDisabled": false,
  "value": 2,
  "startValue": "2.0",
  "startDisabled": false
}
        

            {
  "__v": 1,
  "name": "password",
  "error": 0,
  "isTouched": false,
  "isChanged": false,
  "isDisabled": false,
  "value": "secret",
  "startValue": "secret",
  "startDisabled": false
}
        
            {
  "__v": 1,
  "name": "colorName",
  "error": 0,
  "isTouched": false,
  "isChanged": false,
  "isDisabled": false,
  "value": "#FF00FF",
  "startValue": "#FF00FF",
  "startDisabled": false
}
        

            {
  "__v": 1,
  "name": "range",
  "error": 0,
  "isTouched": false,
  "isChanged": false,
  "isDisabled": false,
  "value": 30,
  "startValue": 30,
  "startDisabled": false
}
        
            {
  "__v": 1,
  "name": "textarea",
  "error": 0,
  "isTouched": false,
  "isChanged": false,
  "isDisabled": false,
  "value": "",
  "startValue": "",
  "startDisabled": false
}
        

Radiobutton1
Radiobutton2*
Required field
            {
  "__v": 1,
  "name": "radiobutton1",
  "error": 0,
  "isTouched": false,
  "isChanged": false,
  "isDisabled": false,
  "value": "6",
  "startValue": "6",
  "startDisabled": false
}
        
            {
  "__v": 1,
  "name": "radiobutton2",
  "error": 5,
  "isTouched": false,
  "isChanged": false,
  "isDisabled": false,
  "startDisabled": false
}
        

Required field. This warning will show even if the input hasn't been touched.
            {
  "__v": 1,
  "name": "select1",
  "error": 5,
  "isTouched": false,
  "isChanged": false,
  "isDisabled": false,
  "startDisabled": false
}
        
            {
  "__v": 1,
  "name": "select2",
  "error": 0,
  "isTouched": false,
  "isChanged": false,
  "isDisabled": false,
  "value": {
    "value": "5",
    "id": "3"
  },
  "startValue": {
    "value": "5",
    "id": "3"
  },
  "startDisabled": false
}
        

Cannot submit until form errors are corrected.

Form Status
            {
  "globalError": 7,
  "isChanged": false,
  "isSubmitted": false,
  "isTouched": false,
  "isValid": false,
  "submissions": 0
}