Re: Best way to trigger javascript function when returning a page from django view

2015-09-21 Thread Martín Torre Castro
I'm looking soon which cases don't return the form filled with data, but I've just tested and we have one that validates, but doesn't return the data fields filled. Maybe we're doing something wrong. I'm investigating. On 21 September 2015 at 04:11, Vijay Khemlani wrote: >

Re: Best way to trigger javascript function when returning a page from django view

2015-09-20 Thread Vijay Khemlani
"It's true that when it's not filled correctly, the form returns the validation but we have cases in which the data in the fields is not returned when the form operation is not successful." What cases? Dynamic fields or something like that? Django forms are supposed to pre-fill all the fields

Re: Best way to trigger javascript function when returning a page from django view

2015-09-19 Thread Luis Zárate
In the success method do something like $('myform').reset (); I don't understand well but if you have cache clean it too. El sábado, 19 de septiembre de 2015, Martín Torre Castro < martin.torre.cas...@gmail.com> escribió: > Maybe I should have made the context more clear. > > First of all, we're

Re: Best way to trigger javascript function when returning a page from django view

2015-09-19 Thread Martín Torre Castro
Maybe I should have made the context more clear. First of all, we're not using ModelForms but just Django Forms. It's true that when it's not filled correctly, the form returns the validation but we have cases in which the data in the fields is not returned when the form operation is not

Re: Best way to trigger javascript function when returning a page from django view

2015-09-19 Thread Gergely Polonkai
Hello, I can't see the use case here. If you are submitting the form with AJAX, why would you store it? Or, if I misunderstood you and you submit in the non-AJAX way, Django will send give you back your filled form with the validation errors. Best, Gergely On 19 Sep 2015 10:09, "Martin Torre

Best way to trigger javascript function when returning a page from django view

2015-09-19 Thread Martin Torre Castro
Hello, I have a django project where I make requests to the server views both by AJAX and the usual simple URL requests to Django. The thing is that I have made one javascript function for storing the forms contents in the HTML5 webstorage and I want to clear the stored data after coming