Input element - error message when...

User 1716255 Photo


Registered User
5 posts

I have a simple contact form on my site but I'm having problems with an input element.

The input element is where the user enters their name but if the user enters a first and second name a 'Please match the requested format' error is shown. A single name/word works OK.

I think it's something to do with the 'pattern' attribute which I currently have set to [a-zA-Z0-9]+
Not sure if this is correct - any help appreciated.
User 187934 Photo


Senior Advisor
20,271 posts
Online Now

Hi Leem,
Add a space to your reg. Exp.
[a-zA-Z0-9 ]+
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 1716255 Photo


Registered User
5 posts

Hi Eric,

Thanks very much, that seems to have fixed it.

Is it absolutely necessary to add the pattern attribute ?

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.