Reputation: 1839
In my project I am disabling an Input file after loading files. When I submit the form, I can not retrieve the files that I have pass. In the opposite direction, once I activate the input, the files reappear.
$('input[name="files[]"]').attr('disabled',true)
I want to know if there is a way to resolve this issue.
'files' =>
array (size=5)
'name' =>
array (size=3)
0 => string '3.jpg' (length=5)
1 => string '2.jpg' (length=5)
2 => string '1.jpg' (length=5)
'type' =>
array (size=3)
0 => string 'image/jpeg' (length=10)
1 => string 'image/jpeg' (length=10)
2 => string 'image/jpeg' (length=10)
'tmp_name' =>
array (size=3)
0 => string '/tmp/phptPZXzB' (length=14)
1 => string '/tmp/phpGgGVuT' (length=14)
2 => string '/tmp/phpFQdZpb' (length=14)
'error' =>
array (size=3)
0 => int 0
1 => int 0
2 => int 0
'size' =>
array (size=3)
0 => int 152903
1 => int 154259
2 => int 137271
Upvotes: 1
Views: 61
Reputation: 654
Use readonly attribute instead of disabled : https://www.w3schools.com/tags/att_input_readonly.asp
Upvotes: 1