Menu icon Foundation
Abide alpha_numeric bug? 5.2.1

I have a text box with alpha_numeric required. Now when I have a space in the text, it says its invalid. This worked in 5.0 and according to the docs: alpha_numeric A1 Sauce.

abide

I have a text box with alpha_numeric required. Now when I have a space in the text, it says its invalid. This worked in 5.0 and according to the docs: alpha_numeric A1 Sauce.

Rafi Benkual over 5 years ago

Looks like there is an open GitHub issue for this. https://github.com/zurb/foundation/issues/4825

If you have a solution please submit a PR because it will help the community. Thanks!

ndh over 5 years ago

Rafi,

I opened that GitHub issue today.

Thanks

Ricardo Vermaat over 5 years ago

I also ran into this issue. After checking the foundation.abide.js file I noticed that the regex for alpha_numeric (/[a-zA-Z0-9]+$/) does not include a space character.

Changing line 16 to

alpha_numeric : /^[a-zA-Z0-9 ]+$/,

(with a space after the 9) should fix the problem.

Working regex example here:
http://regex101.com/r/zR5mS8

ndh over 5 years ago

Thanks Ricardo!