JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › ComboBox › limiting combobox size › Reply To: limiting combobox size
April 22, 2022 at 9:04 pm
#103099
Participant
ok thanks – is this the best way to limit the number of characters in a combo-box?
https://codepen.io/edwardsmarkf/pen/mdpogEL
window.onload = () => {
. . for ( let results in document.getElementById(“my-smart-combo-box”).getElementsByTagName(‘INPUT’) )
. . {
. . . . let tmp = document.getElementById(“my-smart-combo-box”).getElementsByTagName(‘INPUT’)[results] ;
. . . . if ( (typeof tmp == ‘object’) && tmp.getAttribute(‘class’) == ‘smart-input’)
. . . . {
. . . . . . . . tmp.setAttribute(‘maxlength’, ‘3’);
. . . . . . . . break;
. . . . }
. . }
}
-
This reply was modified 2 years, 4 months ago by
edwardsmarkff.
-
This reply was modified 2 years, 4 months ago by
edwardsmarkff.