Secure Way To Use Parsley.js Validation in Form

225 views Asked by At

I am using Parsley.js for validation purpose of form. It works well for me as following.

<input type="text" class="form-control" id="first_name" name="first_name" data-parsley-required-message="Enter First Name" required/>

Now, I think it is not secure for form validation. As anyone can go through InspectElement from the browser and remove the required attribute From Inspect.

So can I use parsley.js with jQuery or JavaScript for field validation?

1

There are 1 answers

1
Marc-André Lafortune On

There is no way to "secure" your form. A hacker could directly post anything to your server. You absolutely have to do the validations server side too, no way around it.

The reason we do validations client side is to provide a good user experience, not for security purposes.