Re:Show HN: validate.js - lightweight JavaScript form valida...
by kgtm on Monday October 17, 2011 @01:43PM
(#3121516)
While client-side validation provides a possibly snappier user experience, developers should constantly be reminded that the client cannot be trusted. Data integrity checks and conformance validation that matters must take place at the other end of the transaction.
[ Parent
| on HN ]
Re:Show HN: validate.js - lightweight JavaScript form valida...
by rickharrison on Monday October 17, 2011 @01:44PM
(#3121527)
I completely agree. I will probably add a note in the docs to remind people that you should always still perform server side checks.
Re:Show HN: validate.js - lightweight JavaScript form valida...
by btucker on Monday October 17, 2011 @01:47PM
(#3121550)
It would also be cool if there was some documentation on how you might use validate.js in concert with server-side validations.
Re:Show HN: validate.js - lightweight JavaScript form valida...
by javanix on Monday October 17, 2011 @02:02PM
(#3121620)
There isn't really any way to dovetail client-side validation with server-side validation.
Client-side validation should always be assumed to be disabled completely - view it as merely a convenience for your users. Help them switch dates into a correct format, make sure their userids aren't taken before they finish filling out their forms, that sort of thing.
Re:Show HN: validate.js - lightweight JavaScript form valida...
by aaronblohowiak on Monday October 17, 2011 @02:10PM
(#3121659)
>There isn't really any way to dovetail client-side validation with server-side validation
I think the parent of your comment was talking about using SSJS to re-use validation on both ends of the pipe.
Re:Show HN: validate.js - lightweight JavaScript form valida...
by rickharrison on Monday October 17, 2011 @02:29PM
(#3121756)
I will be adding server-side js support, so this will be a definite use case.
Re:Show HN: validate.js - lightweight JavaScript form valida...
by hackernews on Monday October 17, 2011 @09:53PM
(#3123453)
I am still implementing form validations as server-side validations and not sure I will ever change that.
Super easy to deal with on a simple ajax request and it's in place for all requests. If a POST/PUT is done with an ajax request simply return the error message. Otherwise, set the HTTP status code and render the form with the error as the response.