Adding Custom Form Validation for a Full Name input field


Hey guys,
I tried using the code below for a Full Name validation in a single input field with a space between the texts(a space between the first and second name). But for some reasons I couldn’t make it work! Will you please kindly have a look at it?

This is the code:

And this is my landing page:



Hi @Nayon,

The problem is with your regex validation rule. Currently, any single character would validate it.

I would strongly advise against validating Full Name since it would open you up to a world of edge cases.

However, if you still want to proceed just Google a proper full name regex validation.



Hello Hristian,
Thanks for your quick response!
I understand the complexity with it but I still need to do it!

And I followed your suggestion of Googling it. And found this:

But I am not really a javascript guy! I don’t know how to put it in my above code. Will you please kindly help me here?


Actually I solved it! with this code:


Hi @Nayon,

I’m happy you’ve found a solution but like I said any regex checking a full name would open up dozens of edge cases.

Your current implementation doesn’t account for names having: hyphens (common in last names), more than 2 names, names with apostrophes and probably a bunch of other variations.



Yeah, I totally understand why you told me not to go with it! But my client demanded even after hearing what complications it might bring in!
So, had to do it.

Thanks for you suggestions and replies man.