Mijo 5 Posted December 25, 2017 Hello everyone, I have Bootstrap select on my website ( https://silviomoreto.github.io/bootstrap-select/examples/ ), im trying to make foreach loop that lists all my brands with url. i want to have possibility that user can search (select brand) and than they go to that specific url, my code is below, can anybody help me with this,? Thank you all. <select> <?php foreach ( $pages->find('template=single, sort=-created') as $single ):?> <option id="brand-filter" value="<?=$single->url?>" <?=$single->title?> </option> <? endforeach; ?> </select> Share this post Link to post Share on other sites
Macrura 3,083 Posted December 25, 2017 I would fix your markup, remove the ID from the option since that won't validate (multiple same id). Also, it looks like you are not closing the opening tag for the option. in order to have it searchable, you'd need to add data-live-search="true" to your select element. for running an action, you would need to do like an onChange event and then window.location.replace with the value of the selected option.. 1 Share this post Link to post Share on other sites