I use Yii2 framework and implemented the form that contains plain input fields and one component for image upload.
Everything works fine when I first time upload the image but when I reopen the previously saved data in the form - it shows me the previously saved image but when I press Send
button the validation asks me to upload the image.
As you may see from the screenshot below - the image is already loaded.
How to tell to the Yii2 validation mechanism, in this case, to properly understand that the image is already loaded and there are no more need to show the error message?
I guess when you say "I reopen the previously saved data in the form
", you're talking about updating, if so, I believe that your model is sending you all your data for your "_form
" but when you press send
it sends you the error because it does not find the respective FILE
, but only its name or address stored in the database.
Can you show your "function rules
" of your model, your "_form
", and your "actionCreate
" and "actionUpdate
" please.
apologies for my english I hope you understand.