R
R
Ravenenok2015-10-11 12:11:11
Yii
Ravenenok, 2015-10-11 12:11:11

How to make a file upload mandatory depending on the selected value in the list?

There is a simple form for adding new information.
The form has a selection list and a file upload form. Now in the model it is indicated that files are an optional field, how to make it so that the mandatory presence of a file depends on the value selected in the list?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ravenenok, 2015-10-11
@Ravenenok

Figured it out myself.
Everything is in the docs - www.yiiframework.com/doc-2.0/guide-input-validatio... Conditional Validation section

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question