lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 16 June 2015 at 23:20, Sean Conner <sean@conman.org> wrote:
It was thus said that the Great Aapo Talvensaari once stated:
> My own homebrew form parsing stuff (uses CGI) is pretty simple to use.

I was not referring particularly to HTTP request parsing, but value filtering (aka modifications), validation (aka true/false checks) and validating filters (those that can modify value, and still return true / false as a validating result for example). And chaining and combining those filters. Pretty much all the decent web frameworks / servers do support input data parsing decently, but they do not tend to solve this filtering part, or they end up with some nasty things like form generators and stuff like that. I'm looking a way to do just form filtering and validation with as less user code as needed (fewer lines to do that repetive thing) and cache those filter chains so that they can be used and reused in all the parts of the web app (maybe at some point even at client side or be coded so that their results can be easily encoded in JSON and be used in AJAX type of validation: two request, first ajax request to server for validation, sencond AJAX or normal request to save/create/delete (of course the server will at this point revalidate as well) – then it is just a few lines of JS to support the json encoded results, e.g. highlight those fileds that have errors.

I'm quite happy with lua-resty-validation but a few things needs to be resolved still. E.g. those that I mentioned in my previous post in this thread.