EuroPython / djep

EuroPython 2014 conference software
https://ep2014.europython.eu/
BSD 3-Clause "New" or "Revised" License
37 stars 18 forks source link

Avatar gets lost when submitting registration / profile form with invalid data #47

Closed MarkusH closed 10 years ago

mgax commented 10 years ago

Looks like django-file-resubmit solves this particular problem.

zerok commented 10 years ago

My preferred solution here would be to have a client-side validation framework in place that simply prevents 99% of the invalid form submissions before they reach the server.

There exist a handful of bindings for libraries like Parsley that try to generate the correct markup/configuration from Django's forms but, sadly, I didn't have much luck with them. Either they clash with crispy-forms or the generated configuration still needs to be tuned to be usable.

Because of that I'd prefer a solution that allows to put the whole validation for a form into JavaScript itself. This obviously leads to code-duplication but it would make the whole process of (1) customizing the validation and (2) localizing it easier.

So the first step here would be to find JavaScript validation frameworks that don't really on additional attributes for the HTML input elements or find out if Parsley is executed late enough that we could inject the required validation rules into the DOM before it is executed.

I'll try the latter now.

zerok commented 10 years ago

I've started on an integration of Parsley in the EuroPython/djep/feature/parsley branch which already does most of what I want for the registration page. There are still some aspects that could be extended and I will to find some time for that in the next couple of days :-)