How to select a field in Jquery $ ui.dropdown

0

Are you all good?

I wanted to leave some fields already selected through some id's that I'll bring from php.

With these id's I would like to compare with the id's already written in the sector field "the ones that are hidden" and the id's that are the same, would be presented within the field.

"as if someone else has been chosen."

obs: in this dropdowm you can select more than one field.

Not without doing it yourself, thanks for the attention.

<script>
            $(document).ready(function () {

                $('.ui.dropdown').dropdown(
                            fields: {
                            remoteValues: 'results',
                            values: 'values',
                            name: 'name',   // displayed dropdown text
                            value: 'value'   // actual dropdown value
                        }
                    }
                );

            });

</script>


           <select name="alcada[]" id="setor" multiple="" class="ui fluid search dropdown">
                            <?
                            foreach ($hashSetor as $setor) {
                                if ($setor['setorID'] == $hashEdit['alcada']) {
                                    $selected = 'selected';
                                } else {
                                    $selected = '';
                                }
                                ?>
                                <option value="<?=$setor['setorID']?>"><?=$setor['nome']?></option>
                            <? } ?>
                        </select>

    
asked by anonymous 22.09.2018 / 03:51

0 answers