Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8092497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:17:44+00:00 2026-06-05T20:17:44+00:00

I am in the process of validating a form that I will be using

  • 0

I am in the process of validating a form that I will be using on my website in order to obtain certain details about a person of business that is registering an online account with us.

I am writing this question in order to obtain a bit of advice on how the validation the following types of information correctly.

In obtain to explain this, I will list a series of data types along with the html validation I had in mind. This could then be reused in a series of php validations amoung other things in order to ensure that the form is always validated correctly, however the standard html validation in my opinion looks better than anything I have been able to achieve by applying my own css.

First Names – ^[a-zA-Z -]{1,120} (a-z, from 1 to 120 characters long, big or small letters)

Last Names – ^[a-zA-Z -]{1,120}

Email Addresses – ^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$ (validation including .com and .co.za domains which is what is mainly used)

If anyone has any suggestions relating to bettering these validation patterns or perhaps some others that are of more standard in use, that info would be greatly appreciated.

Also any information relating to why they should be or should not be used would be great too.

Thanks!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T20:17:45+00:00Added an answer on June 5, 2026 at 8:17 pm

    Your “validation” of names excludes all languages that don’t use the Latin Alphabet. Why? I guess you could check that there aren’t any numbers in there and leave it at that. If you want people without Latin names to be able to use your site then your (database?) should be in a character set such as UTF-8 and you’ll have to allow everything. Even trying to remove rude words can result in the scunthorpe problem.

    Don’t validate e-mails using regular expressions. Mail / ping the address and get the person to click on a link. It is technically impossible to validate an e-mail address using regexes and the better ones that have been developed can be ridiculous. Non-latin domain names exist and as with names you can’t use the Latin alphabet to ensure that they contain what you want.

    Also, as ICANN are currently selling off some new gTLDs, that will substantially increase the available name-space you’re never going to be able to guarantee that something actually exists without checking.

    Obviously, if you’re using a database, use prepared statements to stop SQL Injection.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a html form that I process with a aspx page. I want
Basically I have a page named dvds.asp with a form that goes to action=process.asp
I have a form that validates using the jQuery plugin: Validation, v1.9.0. The validation
I have a website that uses seperate files to process the PHP like the
I process a lot of text/data that I exchange between Python, R, and sometimes
I'm in the process of adding some much needed client side form validation to
I have a simple email form: <form method=post action=process-form.php id=emailForm name=emailForm target=_self> <h4>Sign up
I have that code: jQuery(document).ready(function () { // binds form submission and fields to
I have a singleton class that I am using as part of a CAPTCHA
I have an HTML form on my site that submits via Ajax to a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.