dimanche 29 mars 2015

How to make form field blank after submitting

I have a Django form that has a number of fields that can be edited. Once the current form is submitted, opening the form again populates the form fields with their most recent submitted values.


I have one field "reason_for_change" that I would like to be blank for each subsequent opening of a submitted form.


Basically, when a user reopens the form to be edited, I would like all fields to be repopulated except for the "reason_for_change". I would like this to be blank so that the user doesn't accidentally resubmit the same "reason_for_change".


I am not really sure where to do this. I tried forcing the HTML template value for the "reason_for_change" template equal to '' but that didn't work.


Any suggestions?


Aucun commentaire:

Enregistrer un commentaire