Can the jQuery validate plugin be used to sanitize fields to prevent SQL injection?
Can the jQuery validate plugin be used to sanitize fields to prevent SQL injection? I got the impression that it does but it's not working with the standard settings and I haven't found any information on how specifically to set it up.
These are my current settings:
- $(document).ready(function() {
- // validate signup form on keyup and submit
- var validator = $("#customer_info").validate({
- rules: {
- fname: "required",
- lname: "required",
- user_name: {
- required: true,
- remote: "check_username.php"
- },
- password: {
- required: true,
- minlength: 6
- },
- email: {
- required: true,
- email: true,
- },
- security_question: "required",
- terms: "required",
- },
- messages: {
- fname: "",
- lname: "",
- user_name: {
- required: "",
- remote: jQuery.format('</br>User Name {0} already in use'),
- },
- password: "",
- email: {required: ""},
- security_question: "",
- terms: "</br>Please accept terms and conditions",
- },
- errorLabelContainer: "#messageBox",
- submitHandler: function () {
- jQuery(form).ajaxSubmit({
- });
- }
- });
- });