Suppose I have a form and I wanna prevent the user from submiting the form before validating,
so that I use the event.preventDefault() in onsubmit :
// In my validation.js
$('#myForm').bind('submit', function(event){
event.preventDefault();
// I do the client-side validation here
});
You can see here, the user can edit the validaiton code after preventDefault() line. And they pass the validation (only client side)
What is the more secure way to make a form ‘ajax’ with client-side validation?
I have the server-side validation too, but I just wanna ask how to make the client-side one harder to crack and more secure?
It’s never “more reliable” or “more secure”. JS can be disallowed and there would be no validation on client-side.