2
Using Cakephp in my project, I created a dropdown to use to search the database by values and strings.
I need to create an "all" option to search for all results and to be the "default" option of this dropdown. How can I do that?
Code:
<?php echo $this->Form->create('RegistroHorario', array('class' => 'form-horizontal bucket-form', 'autocomplete' => 'off')); ?>
<div class="col-lg-3">
<?php echo $this->Form->select('RegistroHorario.cliente_id', $clientes, array('empty' => false ,'div' => false,'label'=>false, 'class' => 'form-control m-bot15', 'width' => '10'));?>
</div><div class="col-lg-3">
<?php echo $this->Form->select('RegistroHorario.user_id', $usuarios, array('empty' => false ,'div' => false,'label'=>false, 'class' => 'form-control m-bot15', 'width' => '10'));?>
</div>
<input type="submit" class="btn btn-success" value="Buscar" />
<?php echo $this->Form->end(); ?>
But in the dropdown appear the information of the bank, I wanted to show the field "All" too, and that it came as default
– Julyano Felipe
I updated the answer. I think this should solve the problem.
– Wallace Maxters
It worked, I got it, thanks. I tried to score as useful, but I need 15 reputation points :/ when I hit again try to mark it.
– Julyano Felipe