I want to do something when a file is uploaded and the related checkbox is checked in PHP, how do i link the file input type with the checkbox?
this is what i have:
<input type="file" name="file_upload[]" /> <input type="checkbox" name="checkbox[]"> linked to file-upload 1 <br/>
<input type="file" name="file_upload[]" /> <input type="checkbox" name="checkbox[]"> linked to file-upload 2 <br/>
<input type="file" name="file_upload[]" /> <input type="checkbox" name="checkbox[]"> linked to file-upload 3 <br/>
<input type="file" name="file_upload[]" /> <input type="checkbox" name="checkbox[]"> linked to file-upload 4 <br/>
Give them unique names:
<input type="file" name="file_upload[0]">
<input type="checkbox" name="checkbox[0]">
<input type="file" name="file_upload[1]">
<input type="checkbox" name="checkbox[1]">
PHP will still represent them as arrays.
You may try to set some variable which shows successful upload and then check your checkbox by java script