Answer the question
In order to leave comments, you need to log in
How to check the validation of an array of inputs?
There is a product form, and each product has a different price for different stores (bids). I create the form like this:
<?
$shops = Shops::find()->all();
foreach($shops as $shop)
{
echo "<tr><td>{$shop->login}</td><td>" . $form->field($form, 'bids[' . $shop->id . ']')->textInput()->label(false) . "</td></tr>";
}
?>
['bids', 'each', 'rule' => ['integer', 'min' => '0']],
{"form-bids":["Значение «Ставки» должно быть не меньше 0."]}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question