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
2
Answers
You can also use
test
like:Hope it maybe helpful.