react-bootstrap-validation icon indicating copy to clipboard operation
react-bootstrap-validation copied to clipboard

Number

Open vedran-maestral opened this issue 9 years ago • 1 comments

How do I validate just a number?

vedran-maestral avatar Apr 22 '16 14:04 vedran-maestral

From an upcoming test case... There are several number validators available.

isInt isDecimal isFloat isHexadecimal (technically this is also a number)...

`

        <Form onValidSubmit={validSubmit}>
          <ValidatedInput
          type='text'
          label='Number'
          name='number'
          className='testInput'
          validate='required,isInt'
          errorHelp={{
              required: 'Please enter a number',
              isInt: 'Must be a whole number'
          }}
          />
        </Form>);

brewsoftware avatar Apr 25 '16 07:04 brewsoftware