Release value in a select only if you have already selected another select in cakephp

Asked

Viewed 9 times

0

Hello I have a select called tipo_examand I need another select, called exame_pericia, the select exame_pericia should only be available after I select some value in select 'tipo_exame', other thing, depending on what I select in select tipo_exame, the select exame_pericia will display me only information related to tipo_exame.

Example: if I select 'Ballistics, Instruments and Others' in select tipo_exame, the select exame_pericia can only display me: 'Exam in firearm', now if I select: 'Documentoscopia', the select exame_pericia You can only show me: Murder,

I created the first select that way:

<?= $this->Form->select(
                                    'tipo_pericia',
                                    [
                                        'Balística, Instrumentos e Outros' => 'Balística, Instrumentos e Outros',
                                        'Comunicação Interna' => 'Comunicação Interna',
                                        'Crimes Ambientais' => 'Crimes Ambientais',
                                        'Crimes Contra a Vida' => 'Crimes Contra a Vida',
                                        'Crimes Contra o Patrimônio' => 'Crimes Contra o Patrimônio',
                                        'Documentoscopia' => 'Documentoscopia',
                                        'Outras Perícias' => 'Outras Perícias',
                                        'Outros' => 'Outros',
                                        'Trânsito' => 'Trânsito'
                                    ],
                                    ['class' => 'form-control select1', 'empty' => 'Tipo de perícia', 'label' => false]
                                ) ?>
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.