here’s my dropdown list
<?php $dataCategory=ArrayHelper::map(Movies::find()->asArray()->all(), 'id', 'movie_name');
echo $form->field($model, 'movie_id')->dropDownList($dataCategory,
['prompt'=>'-Choose a Movie-',
'onchange'=>'
$.get( "'.Url::toRoute('screenticketbooking/dependdrop').'", { id: $(this).val() } )
.done(function( data )
{
$( "select#title" ).html( data );
});
'])->label(''); ?>
<?php $dataPost=ArrayHelper::map(MovieShows::find()->where('movie_id=:mov_id',['mov_id'=>$model->movie_id])->asArray()->all(), 'id', 'start_date');
echo $form->field($model, 'show_date')
->dropDownList(
$dataPost,
['id'=>'title','prompt'=>'-Select a Date-']
)->label('');
?>
i have set show_date and movie_id as required in the model but the validation don’t work with ‘show_date’ (even if it is not set it goes to another page on clicking ok)
what should i do to validate the field in the second drop down???
thanks.