New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

required map UI issue #176

Closed
tisdall opened this Issue Sep 1, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@tisdall

tisdall commented Sep 1, 2016

In a form with a PointField widget (it probably does the same for any map widget) the UI in Chrome is less than ideal. The issue is that all the data is encoded and placed in a hidden textarea that's marked as required (the html5 attribute). If a person leaves the field empty and hits "Submit" then you get an error message in the console saying "An invalid form control with name='loc' is not focusable." (where 'loc' is the name of the textarea) and the form simply doesn't submit. This should probably be changed so required is left off of the hidden textarea regardless and the missing data is caught afterwards in Django validation.

This seems to be easily fixed by changing: {% include "floppyforms/textarea.html" %}
to: {% include "floppyforms/textarea.html" with required=False %}
in the openlayers.html file.

@tisdall

This comment has been minimized.

tisdall commented Sep 1, 2016

False as a template variable was added in 1.5, though, so maybe 0 instead.

@gregmuellegger

This comment has been minimized.

Owner

gregmuellegger commented Sep 1, 2016

For the moment you can disable HTML5 validation on the form with <form ... novalidate>.

Or you can use the current master, I just pushed a commit including the required=0 as you suggested. :)

Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment