please give me the code for checking the company name entered in textbox using javascript .Only sentence case to be allowed.Only abbreviations (without a full name) should not be allowed.(eg DPS) Abbreviations if any should be allowed only at the end of the name within ().eg Delhi Public School(DPS)
maria_megha
0
Newbie Poster
Recommended Answers
Jump to PostAnd how would you distinguish that "Dps" is not a company name? Or it is?
Jump to PostOK, you can try to use regular expression to check whether the input string is valid. Below is my attempt to check the string using regex...
// javascript function isCompanyName(str) { str = str.replace(/^\s+|\s+$/g, "") // remove leading/tailing white spaces if (str.match(/^([a-z_]|\W|[A-Z][A-Z]+)/) || // start with lower …
All 5 Replies
Taywin
312
Posting Virtuoso
maria_megha
0
Newbie Poster
Taywin
312
Posting Virtuoso
maria_megha
0
Newbie Poster
Taywin
312
Posting Virtuoso
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.