I have a form that is used to create customers order. Customer are pulled from the database.
Want am trying to achieve is to have a link or button at the end of the dropdownlist used to create new customers. This form should be a modal.
After submitting the form, the newly created customer should be selected on the dropdown list.
I have the modal working but the modal button is outside the dropdownlist......i want it inside
I have a form that is used to create customers order. Customer are pulled from the database. Want am trying to achieve is to have a link or button at the end of the dropdownlist used to create new customers. This form should be a modal.
After submitting the form, the newly created customer should be selected on the dropdown list.
I have the modal working but the modal button is outside the dropdownlist......i want it inside
My deopdownlist
`<?= $form->field($model, 'ser_own_id', ['labelOptions'=>['class'=>'labelchange']])->widget(Select2::classname(),['data'=> ['newclient' => 'Add New'] + ArrayHelper::map(Owner::find()->all(),'owner_id','reg_no'),'language'=>'en', 'options'=>['placeholder'=>'Select Registration Number', 'id'=>'zipCode'], 'pluginOptions'=>[ 'allowClear'=>true ], ]); ?>
Vehicle owner
', 'id' => 'modal', 'size' => 'modal-sm', ]); echo ""; Modal::end(); ?>` Action used by modal to create new customers `public function actionNew() { $model = new Owner(); if ($model->load(Yii::$app->request->post()) && $model->save()) { //return $this->redirect(['view', 'id' => $model->owner_id]); echo 1; } else{ return $this->renderAjax('new', [ 'model' => $model, ]); } }`