Answer the question
In order to leave comments, you need to log in
How to get data from select in url link?
How can I make the link change when the select is changed?
<div class="form-group">
<label class="col-lg-4 control-label" for="focusedInput">Выберите группу:
</label>
<div class="col-lg-6">
<select class="form-control" id="taskOption_group" name="taskOption_group">
<option value="0">- Не выбрано -</option>
<option value="79668981">Сообщество №1</option>
<option value="61439844">Сообщество №2</option>
<option value="66162914">Сообщество №3</option>
<option value="71359952">Сообщество №4</option>
<option value="96811414">Сообщество №5</option>
<option value="68946366">Сообщество №6</option>
</select>
</div>
</div>
<a href="https://vk.com/club{id}">Ссылка</a>
Answer the question
In order to leave comments, you need to log in
$('#taskOption_group').on('change', function() {
if ($(this).val() !== '0') {
document.location.href = 'https://vk.com/club' + $(this).val();
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question