i have to update data with input type file (picture) but when the user didn't update the picture an error of security appears i try to fix the problem with this answer with 21 vote and i get this in the console There is an input without a value! <input id="im1" class="dropify-fr" type="file" data-max-file-size="200K" data-default-file="images/formules-v1/thumb/art.jpg" name="photo1">
but i don't know how to resolve this problem who have an idea to resolve it?
any help ? thanks
-
So you confirmed that this is the same kind of problem as the solution you found... Wich is a solution to identify which input is causing it. Tell us what you did next! – Louys Patrice Bessette Jun 22 '16 at 10:10
-
as i find i can't set a default value for an input with type file(in my case it is a picture), my issue that how can i allowed the user to update the other data without updating input file ( for example updating name , phone and the picture still the same ) – lolla Jun 22 '16 at 11:32
1 Answers
From comments below the question:
«as i find i can't set a default value for an input with type file»
The thing is that you did not show your code...
AND, I never encountered this error, personnaly.
→ So this answer is a guess... Enought sure to post.
From my understanding of the answer you cited, The error you have is because you try to change input values programmatically.
Before a submit, I doubt the user can't update/change it's file input value.
But if, for some reason, you need to change any input values except file programmatically, like after a form validation that show a modal or something...
You could use this jQuery selector within a condition:
$("input").not( ":file" ); // Gives a boolean false on type file, true on everyone else.
It would be easier to just return him to the original form.
Just retain the final submit()
until all answers are correct.
Now, if you want to change the file input value, it is not possible.
This SO answer clearly states why.

- 1
- 1

- 33,375
- 6
- 36
- 64