0

I'm using Django to set up a website, where users can add spatial informations associated with ecological datasets. I'm using leafletjs to display pins on the map, where datasets have been sampled.

The solution I have now, is to have users write lat/lon as fields. On the other hand, there is an example on the leaflet website where clicking on the map will display the coordinates, and that is much more user friendly. So I'd like to have this + a javascript to fill the lat/lon position, in the form rendered by Django.

Is there any chance I can put that in a Django form, or must I write the form in HTML?

1 Answers1

0

In this case, I would use an AJAX form to post entries in the back end, and upon submission recall the entries and write it out as JSON. Django has native functionality for all of this.

Here is a recent SO example: How to submit form without refreshing page using Django, Ajax, jQuery?

Community
  • 1
  • 1
Andrew Sledge
  • 10,163
  • 2
  • 29
  • 30