PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, March 19, 2022

[FIXED] How to just display the data on a dropdown field in yii2.0 but being able to write any option?

 March 19, 2022     php, yii, yii-extensions, yii2, yii2-advanced-app     No comments   

Issue

I´m more or less new in the Yii 2.0 framework and I´ve been having a serious problem with this situation. I want a dropdown list that shows the differents values I already used in the past but that let me write whatever I want. Like this:

enter image description here

this is the code:

$form->field($model, 'order_idorder')->widget(Select2::classname(), [
        'data' => ArrayHelper::map(Order::find()->joinWith('compartmentIdCompartment')->joinWith('hybridIdHybr')->orderBy('idorder')->all(),
            'idorder', 'fullName'),
        'options' => ['placeholder' => Yii::t('app', 'Choose Order')],
        'pluginOptions' => [
            'allowClear' => true
        ],
    ]);`

The problem with this is that I need to choose one of the options in the dropdown. And I want just the information being display, without the need of actually selecting anything.


Solution

After some days searching for the answer, I finally found this:

Demo: http://www.dhtmlgoodies.com/scripts/form_widget_editable_select/form_widget_editable_select.html

Code:
http://www.dhtmlgoodies.com/index.html?whichScript=form_widget_editable_select



Answered By - Matías Joaquín Tucci
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing