in my case, when I click on choose file input I i set a variable to 1.
Once you choose the file this variable remains at 1.
if it cancels, closes the window without selecting a file to upload I would like to return this variable to 0 it possible?
tnx
If I understand you correct I would go the other way. If you click the file chooser set the variable to 0, and only set the variable to 1 if the value of the file input changes.
Html
Js
See http://jsfiddle.net/JWRgY/ for a demo.