Closed samanamarasinghe closed 11 years ago
I tried to debug it (changed from just a submit to a javascript call submit1) but still have bugs. Can you take a look?
@samanamarasinghe I'm confused how is this feature working before? Because after some googling, I think that jQuery AJAX cannot post a form containing a file uploading field.
I found some plugin (http://www.malsup.com/jquery/form/) that support uploading a form with file field (via some iFrame hacking I guess). But our form is kind of dynamically generated (the "submit" field change when you click different buttons), thus it is not easy to use with that plugin. We might need an alternative way to solve this.
Strange, it used to work before.
What worked before was...
@samanamarasinghe I guess directly submitting should work, but using jquery to submit through AJAX would fail?
I put the wrong "previous" code there. Now I restored it (see file). It seems to do the post, but I think to the wrong page (I think might be to the top page instead of setup page). Now sure how to fix this.... Do you have a better idea of what is going on?
The HTML form can be specified with an action
attribute indicating where we want to submit to. I tried to modify that, and I think now the submitting works (use the first-row buttons there). However, in order to get back to the setup page after submitting, I added an explicit HTTPRedirect in the views.py for the setup function when the request is a POST. This should be OK for all the buttons that uploading a files. But I noticed there CalcAve
and UpdatePay
also under POST. I'm not sure whether they are OK with the HTTPRedirect.
fixed in revision 289.
When data file is uploaded from eduoffice->setup there is no feedback, the page refreshes. Not even sure if the data file gets uploaded.