0
Guys all good??
I wanted to leave some fields already selected through an 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 "those that are hidden" and the id’s that are equal, would be displayed within the field.
"as if someone was chosen such sector".
Obs: in this dropdowm to select more than one field.
Not without how to do it, thanks for your 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>
Hey, buddy, here’s a better explanation because you can’t figure out where you’re going with this. You are a little confused and with spelling mistakes that make it very difficult to understand. By the way, you can’t even understand. Abs!
– Sam
Sorry, I already edited the text.
– Alexandre Mendes Nunes
Have you tried putting the
$selected
in the option:<option <?=$selected?> value="<?=$setor?>"><?=$setor?></option>
?– Sam
There is no logic to this, I will simply put the option ...and not set it..
– Alexandre Mendes Nunes
What’s happening here... is that I selected a user in a list and the system put their information in the page’s <inputs> fields so that I can edit these infomations. only that I have to specify in this sector field which sectors it belongs to.
– Alexandre Mendes Nunes
So... if you put the options as Selected do not appear listed the sectors coming from PHP?
– Sam
Um.. maybe but maybe bad because I’m already printing on "foreach" ...but you gave me an idea.
– Alexandre Mendes Nunes