You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browser and OS: iPad iOS 11 Safari—probably also earlier versions
Issue description
Hey there, folks!
Braintree seems to selectively apply pattern=[0-9] to numeric input elements on iOS, presumably to bring up the numeric keypad.
This is sensible—but a small side-effect this causes is that if you're on an iPad, the numeric keypad includes a "Return" key, which will attempt to submit a form. If you've entered a full expiration date, this will technically invalidate the pattern attribute, which doesn't expect the forward slash, and causes an error, which could be quite confusing, as the user-facing "requested format" is definitely met. See this example from one of your CodePen example integrations—the same issue is occurring in a project I'm working on currently.
This is possibly something you can overcome by also including a novalidate attribute on the containing form. This is normally quite a heavy-handed approach, but considering each hosted field is inside its own iframe with its own form—I can't immediately think of a downside to doing this.
I was wondering if this is something you've come across earlier or if there's a way to configure Hosted Fields to apply the novalidate attribute to the parent form element?
Thank you for your time. :)
The text was updated successfully, but these errors were encountered:
At first glance, I think it could be reasonable to add novalidate to all the hosted fields, since the validation is done by hosted fields itself already without the assistance of HTML5's built in validation.
General information
Issue description
Hey there, folks!
Braintree seems to selectively apply
pattern=[0-9]
to numeric input elements on iOS, presumably to bring up the numeric keypad.This is sensible—but a small side-effect this causes is that if you're on an iPad, the numeric keypad includes a "Return" key, which will attempt to submit a form. If you've entered a full expiration date, this will technically invalidate the
pattern
attribute, which doesn't expect the forward slash, and causes an error, which could be quite confusing, as the user-facing "requested format" is definitely met. See this example from one of your CodePen example integrations—the same issue is occurring in a project I'm working on currently.This is possibly something you can overcome by also including a
novalidate
attribute on the containing form. This is normally quite a heavy-handed approach, but considering each hosted field is inside its own iframe with its own form—I can't immediately think of a downside to doing this.I was wondering if this is something you've come across earlier or if there's a way to configure Hosted Fields to apply the
novalidate
attribute to the parent form element?Thank you for your time. :)
The text was updated successfully, but these errors were encountered: