jquery-editable-select icon indicating copy to clipboard operation
jquery-editable-select copied to clipboard

Clear value on blur when no item is selected

Open liglesiash opened this issue 6 years ago • 1 comments

Hi. When I filter an editable-select and select no item, but a previous item was selected, I 'd like to clear the value (on blur, hide or any where else). Could any one help me?

liglesiash avatar Jan 31 '20 13:01 liglesiash

How about using some brute force :

var comboRef = document.getElementById('yourcomboid'); var isMatch = false; var liElems = comboRef .parentNode.getElementsByTagName("li"); for(var i=0;i<liElems.length;i++){ if(liElems[i].value==comboRef .value){ isMatch = true; break; } } if(!isMatch) comboRef .value='';

AmanKhan9 avatar Sep 09 '20 13:09 AmanKhan9