Javascript string checking

I am rather new to JavaScript and trying to teach myself javascript form validation. Would it be possible to get a quick run through of different variables and how to prevent SQL injection?

I am currently using the variable to test if my passwords match some level of security. Would it be possible to see an example variable that requires a user to enter at least one number and at least one Upper case letter mixed in with their other lowercase letters.

var passw= /^[a-zA-Z]*.{8,15}$/;

Much obliged and thanks very much


If you're trying to prevent SQL injection, then you need to do it server-side. Doing it client-side is pointless, because it is fairly trivial for some evil-doer to intercept the requests and change the values, bypassing your client-side validation.

With that said, if you're using node.js or some other javascript based server-side engine, then you can do your validation there. There is a very thorough answer on how to do this server-side in node.js here.

Need Your Help

MSAccess: select N records from each category

sql ms-access

I can't solve this on MS Access SQL.

custom calculation function Sencha Touch

javascript extjs model-view-controller sencha-touch-2 sencha-touch-2.1

I'm working in Sencha Touch 2.4 and I want to perform calculation on specific view card. However, is it possible to define the calculation function outside the view (may be in model or controller) so

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.