I have simple form in react and form has got an email input textbox. I am using pattern for email validation. It worked in another page but the same validation not working in another page and it throws 'Please match the format required' when i click on submit button
const emailPattern = '^[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}$'; <InputText key="contactEmail" label="Email address" defaultValue={employer.contact ? employer.contact.email : ''} type="text" id="email" name="email" fullWidth={true} pattern={emailPattern} message="Valid email address required" onChange={(e) => { handleChange(e.currentTarget.value, 'contact.email'); }} />
1.4m articles
1.4m replys
5 comments
57.0k users