What's new

Welcome to the forum 👋, Visitor

To access the forum content and all our services, you must register or log in to the forum. Becoming a member of the forum is completely free.

HTML5 pattern attribute throws console errors

ppowell777

New member
Joined
May 24, 2025
Messages
4
Reaction score
0
HTML Coins
60
I have created an HTML page that produces a form with fields that have 'pattern=".."' attributes, however, before JavaScript can take over and remove the pattern attributes in favor of JavaScript validation, HTML5 itself, via Chrome, throws console errors trying to validate the regular expressions, any regular expressions, all of them fail: There is no "/v" in my pattern; there are only single backslashes in the pattern, and JavaScript successfully removes the pattern attributes from every form field only AFTER the errors are logged in the console. I have no idea why this is happening. Is this a Chrome bug, an HTML5 bug, or something I missed?

Pattern attribute value [-a-zA-Z'\s\.]+ is not a valid regular expression: Uncaught SyntaxError: Invalid regular expression: /[-a-zA-Z'\s\.]+/v: Invalid character in character class
 

Theme customization system

You can customize some areas of the forum theme from this menu.

  • Wide/Narrow view

    You can control a structure that you can use to use your theme wide or narrow.

    Grid view forum list

    You can control the layout of the forum list in a grid or ordinary listing style structure.

    Picture grid mode

    You can control the structure where you can open/close images in the grid forum list.

    Close sidebar

    You can get rid of the crowded view in the forum by closing the sidebar.

    Fixed sidebar

    You can make it more useful and easier to access by pinning the sidebar.

    Close radius

    You can use the radius at the corners of the blocks according to your taste by closing/opening it.

  • Choose the color combination that reflects your taste
    Background images
    Color gradient backgrounds
Back