Smart UI Components & Libraries – Grid, Scheduler, Gantt, Kanban for Angular, React, Next.js, Vue, Blazor, JavaScript › Forums › General Discussions › ComboBox › limiting combobox size › Reply To: limiting combobox size
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 3 years, 10 months ago by
edwardsmarkff.
-
This reply was modified 3 years, 10 months ago by
edwardsmarkff.