Menu
I've researched this but none of the code I use seems to work. South African ID numbers contain date of birth and gender. All I want is it to pull in that information and verify it when their ID number is entered into an input field, preferably in jQuery or javascript
Any help is appreciated,
Dawid
Dawid van der HovenDawid van der Hoven
You could also try a new SMS service to check your ID status. Send a SMS with the letter “D” followed by your ID number to 32551 in SA. You should – theoretically – then receive a response informing you if a brother from another mother is using your ID to cause some form a mayhem in SA. Generate (Fake) South-African ID Numbers. Year of Birth. Month of Birth. Day of Birth. Show expert options. Hint: submit the form to get an ID number. More Information. See Wikipedia or this article. Read the code. Generate (Fake) South-African ID Numbers.
![Sa Id Number Generator Sa Id Number Generator](/uploads/1/2/6/2/126240427/955955930.jpg)
3 Answers
You could use Koenyn's regex validation, not so sure how a single-digit number (0-9?) from the input represents the gender but basing on this tool you provided and David Russell's Using Javascript to validate South African ID Numbers, here's an untested attempt:
UPDATE 1:After following this thread, What is a South African ID number made up of?, I updated my implementation to include the gender and citizenship tests.
UPDATE 2:Forgot to wrap the month number increment
id_month + 1
within the date string fullDate
, updating solution with Dawid's fix.HTML Markup:
Javascript:
DEMO: http://jsfiddle.net/chridam/VSKNx/
chridamchridam
this is the validation regex we us at our company:
as far as using regex, it's really simple http://www.w3schools.com/jsref/jsref_obj_regexp.asp
KoenynKoenyn
There is a jQuery plugin that you can use. Check it out at http://www.verifyid.co.za/jqueryid
6dev6il66dev6il6
Not the answer you're looking for? Browse other questions tagged javascriptjqueryvalidation or ask your own question.
How to calculate age from ID number in Excel?
Supposing, you have a list of ID numbers which contain 13 digit numbers, and the first 6 numbers is the birth date. For example, the ID number 9808020181286 means the birth date is 1998/08/02. How could you get the age from ID number as following screenshot shown quickly in Excel?
Kutools for Excel contains a powerful Formulas utility which collects some commonly used formulas can help you do some usual calculations quickly and easy, such as calculate age, add years, months, days to date, sum absolute values etc. Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days. Download and free trial Now! |
Recommended Excel Productivity Tools
Bring tabbed editing and browsing to Office (include Excel), much more powerful than the browser's tabs. Free Download...
More than300 powerful advanced features for Excel, designed for1500 work scenarios, save70% time for you. Free Download...
Calculate age from ID number with formula
To calculate age from ID number, the following formula can help you. Please do as this:
Enter this formula:
=DATEDIF(DATE(IF(LEFT(A2,2)>TEXT(TODAY(),'YY'),'19'&LEFT(A2,2),'20'&LEFT(A2,2)),MID(A2,3,2),MID(A2,5,2)),TODAY(),'y') into a blank cell where you want to calculate the age, and then drag the fill handle down to the cells you want to apply this formula, and the ages have been calculated from the ID numbers at once, see screenshot:
Notes:
1. In the above formula, A2 is the cell contains the ID number you want to calculate the age based on.
2. With the above formula, if the year is less that current year it will be considered as 20, if year is greater than current year will be considered as 19. For instance, if this year is 2016, the ID number 1209132310091’s birth date is 2012/09/13; the ID number 3902172309334’s birth date is 1939/02/17.
Recommended Productivity Tools for Excel
Kutools for Excel Helps You Always Finish Work Ahead of Time, and Stand Out From Crowd
- More than300 powerful advanced features, designed for1500 work scenarios, increasing productivity by70%, give you more time to take care of family and enjoy life.
- No longer need memorizing formulas and VBA codes, give your brain a rest from now on.
- Become an Excel expert in 3 minutes, Complicated and repeated operations can be done in seconds,
- Reduce thousands of keyboard & mouse operations every day, say goodbye to occupational diseases now.
- 110,000 highly effective people and 300+ world-renowned companies' choice.
- 60-day full features free trial. 60-day money back guarantees. 2 years of free upgrade and support.
Brings Tabbed Browsing and Editing to Microsoft Office, Far More Powerful Than The Browser's Tabs
- Office Tab is designed for Word, Excel, PowerPoint and Other Office Applications: Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by50%, and reduces hundreds of mouse clicks for you every day!
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
- Cuál es la formula en español???
- To post as a guest, your comment is unpublished.U are so cool. Can get two ic for we
- To post as a guest, your comment is unpublished.very cool, works