Australian License Number Validation
-
Hi All! I have to put a validation for Australian License Number.It's required format is as per below.
Validation Maximum length of 9 characters. Alphanumeric characters only. Must have at least 4 numeric characters. Must have no more than 2 alphabetic characters. The third and fourth characters must be numeric.
can anyone please suggest any custom validation or javascript ? Thank you, Regards.."Save water,It's precious" :) "Don't forget to vote" ;) ;P ;)
-
Hi All! I have to put a validation for Australian License Number.It's required format is as per below.
Validation Maximum length of 9 characters. Alphanumeric characters only. Must have at least 4 numeric characters. Must have no more than 2 alphabetic characters. The third and fourth characters must be numeric.
can anyone please suggest any custom validation or javascript ? Thank you, Regards.."Save water,It's precious" :) "Don't forget to vote" ;) ;P ;)
Sounds like a regular expression to me.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
Sounds like a regular expression to me.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
Yes,it can be anything.It may be a regular expression or custom validator or javascript. Thanks for the response. Regards.
"Save water,It's precious" :) "Don't forget to vote" ;) ;P ;)
-
Yes,it can be anything.It may be a regular expression or custom validator or javascript. Thanks for the response. Regards.
"Save water,It's precious" :) "Don't forget to vote" ;) ;P ;)
Yeah, it COULD be any of those things, but I imagine that a regex is the most logical. expresso is a great tool if you need help working out a regex.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
Yeah, it COULD be any of those things, but I imagine that a regex is the most logical. expresso is a great tool if you need help working out a regex.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
Hi Chris, Thanks for the quick response. I have tried "Expresso".But I can't get the rid of it. Regards.
"Save water,It's precious" :) "Don't forget to vote" ;) ;P ;)
-
Hi Chris, Thanks for the quick response. I have tried "Expresso".But I can't get the rid of it. Regards.
"Save water,It's precious" :) "Don't forget to vote" ;) ;P ;)
Cosmo Thought wrote:
Expresso
Try it here: www.codeproject.com/KB/dotnet/expresso.aspx[^]
Vasudevan Deepak Kumar Personal Homepage
Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson -
Cosmo Thought wrote:
Expresso
Try it here: www.codeproject.com/KB/dotnet/expresso.aspx[^]
Vasudevan Deepak Kumar Personal Homepage
Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis LevinsonHi Vasudevan Deepak Kumar, Thanks for response. I have "Expresso". I have tried this. But I can't figure out the correct expression. I can't make expression with
numeric
andalphabetic
. somewhere I am wrong. I am still playing with "Expresso".....:confused:"Save water,It's precious" :) "Don't forget to vote" ;) ;P ;)
-
Hi Vasudevan Deepak Kumar, Thanks for response. I have "Expresso". I have tried this. But I can't figure out the correct expression. I can't make expression with
numeric
andalphabetic
. somewhere I am wrong. I am still playing with "Expresso".....:confused:"Save water,It's precious" :) "Don't forget to vote" ;) ;P ;)
U can try out for Javascript posted below Expresso cannot work for the expressions like this. That becomes tough for Expresso. Try this.. put the code in ur jscript
function nx(obj) { var str = document.getElementById(obj).value; if(str.length > 3 && str.length < 10) { if((str.charCodeAt(2) > 47 && str.charCodeAt(2) < 58) && (str.charCodeAt(3) > 47 && str.charCodeAt(3) < 58)) { var c = 0; var n = 0; for(i = 0 ; i < str.length ; i++) { if(str.charCodeAt(i) > 47 && str.charCodeAt(i) < 58) { n++ } else { c++ } } if(n < 4 && c > 2) { return false } else { return true; } } else { return false; } } else { return false; } return false; }
The ASCII part is very Improtent to do the task. I hope that will help If work let me know. :)Believe Yourself™ :-\™
-
U can try out for Javascript posted below Expresso cannot work for the expressions like this. That becomes tough for Expresso. Try this.. put the code in ur jscript
function nx(obj) { var str = document.getElementById(obj).value; if(str.length > 3 && str.length < 10) { if((str.charCodeAt(2) > 47 && str.charCodeAt(2) < 58) && (str.charCodeAt(3) > 47 && str.charCodeAt(3) < 58)) { var c = 0; var n = 0; for(i = 0 ; i < str.length ; i++) { if(str.charCodeAt(i) > 47 && str.charCodeAt(i) < 58) { n++ } else { c++ } } if(n < 4 && c > 2) { return false } else { return true; } } else { return false; } } else { return false; } return false; }
The ASCII part is very Improtent to do the task. I hope that will help If work let me know. :)Believe Yourself™ :-\™
Hi Gandalf! Thanks for the reply. I have done it with different method.:cool: Thank you again.. Regards.
"Save water,It's precious" :) "Don't forget to vote" ;) ;P ;)