i want to get the user input in field form "username" and pass it as a condition in dropdownlist in where
this is the form field
<?= $form->field($model, 'Username')->textInput(['maxlength' => true,'readonly' => true]); ?>
this is my code to get the input
$input=Html::getInputId($model, 'Username');
this is my code for dropdownlist
<?= $form->field($model, 'appTime')->widget(Select2::classname(), [
'data' => ArrayHelper::map(Schedule::find()
->where(['user' => $input])
->andWhere(['availability'=> 'available'])->all(),'time','time'),
'language' => 'en',
'options' => ['placeholder' => 'Select time available'],
'pluginOptions' => [
'allowClear' => true
],
]);
?>
but it didnt give an output for the dropdown which means the condition failed. what should i do ?
can anybody tell me how to pass the input when user fill in the textinput ?
Comments
Post a Comment