We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Disable select tag

Here's a simple code for select tag creation :

$mydropdown = $this->tag->Select(
  [
    'prodID',
    $providers, // variable from controller , to populate select tag
    'using' => [
      'id',
      'name',
    ],
    'id' => 'myId',
    'name' => 'myName'
  ]
);

Is it possible and how to set select tag disabled from phalcon to get html structure like this :

<select disabled>  -> the whole select is disabled 
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="mercedes">Mercedes</option>
  <option value="audi">Audi</option>
</select>

Thanks in advance .

There's no support for it out-of-the-box, but you can implement your own class:

https://github.com/phalcon/cphalcon/issues/899#issuecomment-35288369



2.9k
edited Feb '19

Thanks Lajos ! :)

There's no support for it out-of-the-box, but you can implement your own class:

https://github.com/phalcon/cphalcon/issues/899#issuecomment-35288369