simple-react-validator icon indicating copy to clipboard operation
simple-react-validator copied to clipboard

> @sachin8094 how to hide message after filling correct data

Open pooja-yadav-ctrl opened this issue 3 years ago • 0 comments

@sachin8094 Did you try to validate your input in the onBlur event? It works for me.

  const [address, setAddress] = useState()
  const simpleValidator = useRef(new SimpleReactValidator())

  <Input
    name="name"
    value={companyInformation.name}
    onChange={handleInputChange}
    onBlur={simpleValidator.current.showMessageFor('name')} />
  {simpleValidator.current.message('name', companyInformation.name, 'required')}

I try this but it's showing errors on page load not on onblur

Originally posted by @pooja-yadav-ctrl in https://github.com/dockwa/simple-react-validator/issues/97#issuecomment-784217559

pooja-yadav-ctrl avatar Mar 05 '21 14:03 pooja-yadav-ctrl