Answer the question
In order to leave comments, you need to log in
jQuery UI selectmenu How to block dropdown value in another listbox?
Hello!
Can you tell me how to block the value of the dropdown list?
Suppose in the first select we select the value 5, and in the second we block the value 3.
What determines the lock is specified manually.
We have the following:
<form id="IDForm">
<select id="test1" class="ser_art" name="test1">
<option value="5">5</option>
<option value="4">4</option>
<option value="3">3</option>
<option value="2">2</option>
</select>
<select id="test2" class="ser_art" name="test2">
<option value="5">5</option>
<option value="4">4</option>
<option value="3">3</option>
<option value="2">2</option>
</select>
</form>
jQuery( "select" ).selectmenu();
jQuery( "#IDForm select" ).selectmenu({
change: function( event, ui ) {
// тут блокировка
// тут рефреш
}
});
jQuery('#IDForm #test2 option[value="6"]').attr('disabled', 'disabled');
jQuery('#IDForm #test2').selectmenu('refresh');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question