React js input onChange Validation is not Working – Reactjs
onChange={(e) => { if (e.target.value.match("^[a-zA-Z]*$") != null) { setName(e.target.value); // console.log(setName); } else { toast.error("Please match the required format"); } }} this required validation is not working. database is updated with empty string