Answer the question
In order to leave comments, you need to log in
How to work out the link when choosing a nice select?
There is this script
https://pcvector.net/scripts/forms/476-jquery-nice...
Makes a beautiful selector
The task is
<select class="select-beauty js-change-cities">
{foreach $regions as $r}
<option value="{url region_id=$r->id}" {if $r->id == $smarty.session.region_id}selected{/if}>{$r->name|escape}</option>
{/foreach}
</select>
$('.select-beauty').niceSelect();
Answer the question
In order to leave comments, you need to log in
<select class="select-beauty js-change-cities" onchange="location = this.value;">
{foreach $regions as $r}
<option value="http://site.ru{url region_id=$r->id}" {if $r->id == $smarty.session.region_id}selected{/if}>{$r->name|escape}</option>
{/foreach}
</select>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question