On 15 окт, 03:13, Ryan Florence <[email protected]> wrote: > How else would you validate with the server and provide user feedback on the > page with JavaScript? If you actually submit as usual, reload a new page that > validates on the server, just write the validation errors old school with the > server side code, right? >
You submit regular data with ajax request and don't reload the page. On server side using browser headers you distinguish ajax requests from regular requests (e.g. request.is_ajax() in django) and return json for ajax requests or regular html for regular requests. So the server-side code doesn't have to implement different validation for ajax and non-ajax version and there is always a fallback for people with non-working javascript.
