Base code: rutorrent project
This code website uses a lot of JavaScript to built and display its data along with the pop-up dialogs to handle various tasks. In the particular case I’m trying to understand (as a part of js/content.js
), one of the dialogs, 'tadd'
, handles adding new torrents. The dialog collects the data and it’s submit action calls a php module, addtorrent.php
, to do the actual processing.
Most of the data is sent to the php as a part of the request, but the files (if any are selected) are read from the form files. My search is failing me in understanding how I can modify that form after it’s done whatever processing it’s going to do. Specifically, I want to clear out the files list if the processing is successful.
Ideally, I’d hook into some post-submit event in the js and take care of it, but I don’t believe such an event exists.
a) Am I wrong in this belief? And if so, what’s the name of the event?
b) If I’m not wrong, can the php modify the form in the way I’m looking to do?
c) If not, is there a workaround I can use?
I’m currently clearing the fields I care about before displaying the form. However, this is a bit unsatisfying in execution. Perhaps this is the only recourse I have, but I’m hoping there are other options I’m unaware of.