Binding value to htmlform multiselect, bootstrap-select

Ideally, I would want to use webix ui.form, but there is a level of control and styling option that makes htmlform much easier (add class name to specific form elements i.e. input, textarea, select, etc…). I’m trying to use webix in conjunction with the bootstrap-select plugin. While single values work ok, binding multi-value selects has issues.

TypeError: t.options[i] is undefined; can't access its "value" property

Would the approach be to somehow attach to the bind event and run my own script to populate the multiselect?

Would also be interested to know if there is a way to somehow build webix ui.multiselect into a html form.

Thanks

Hi

I see that HTMLform doesn’t return a correct value for multi-selection, still, I can’t reconstruct the error as in your case.

If the issue still occurs, can you please share a snippet or any other kind of demo where the issue can be reconstructed.

is a way to somehow build webix ui.multiselect into a html form.

nope, htmlform tracks raw HTML inputs and will ignore any complex widgets ( it works with bootstrap-select as it uses the raw HTML select inside )

Thanks for the response. Do you know what is passed to the html select element for select with multiple values? Currently in my db it is stored as “A,B,C” with comma delimiter. Before my webix implementation, I placed the sequence into an array before passing it to bootstrap-select method.

After trial and error, I’m pretty sure the error mentioned above is simply because the value isn’t found in the select options. So if the bind passes “A,B,C” literally, I can see why the error occurs.

Per their docs it takes an array for multiple values

$('.selectpicker').selectpicker('val', ['Mustard','Relish']);