Declined
Last Updated: 30 Jan 2023 14:01 by Steven
Steven
Created on: 16 Jan 2023 12:58
Category: MultiSelect
Type: Feature Request
1
MultiSelect does not show up in form.serialize() if no value selected.

Editor components like the pickers, textboxes, etc. use an internal <input> element while submitting to get their value from. This value shows up in form.serialize() even when no value selected/provided.

4 comments
Steven
Posted on: 30 Jan 2023 14:01

Martin,

I won't be submitting a support ticket because:

1. I already did (1593326), which lead to this feature request.

2. I already have a workaround in place.

The purpose of the feature request was so that, in the future, I wouldn't have to use that workaround and the control would report itself to form.serialize() even when empty.  I realize that this is not "normal" functionality for a <select> object... that's why it would be a "feature".  Again, disappointed that this was set to "Declined" so rapidly and not considered.

-Steven

ADMIN
Martin
Posted on: 30 Jan 2023 10:17

Hello, Steven,

I suggest opening a new support thread with further details about your scenario. If you could provide a small Dojo example, it will make it easier to test a possible solution for your case.

Regards,
Martin
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Steven
Posted on: 23 Jan 2023 13:03

Martin,

I don't believe a Kendo Form would not work in the particular scenario that prompted this feature request, as I am building a form dynamically with no model... what is on the form depends on some user selections and can vary significantly.  

Despite the challenges posed by the <select> element, would still be nice if the Telerik version of this could report itself when form.serialize() is called.  Just wanted to throw this out there and see if anyone else had similar issues and would like to see this kind of change.  Unfortunately, since the status has been set to "Declined", I doubt anyone will bother to upvote (but please do anyways!)

-Steven

ADMIN
Martin
Posted on: 23 Jan 2023 10:25

Hello, Steven,

The behaviour can also be observed with a regular <select multiple="multiple"> element. Here is a small example where you can see that. Also, here is a small resource about an HTML form and how the elements in it behave, more specifically the part below:

"Only selected options will be successful (using the control name "component-select"). When no options are selected, the control is not successful and neither the name nor any values are submitted to the server when the form is submitted. Note that where the value attribute is set, it determines the control's initial value, otherwise it's the element's contents."

If you wish to see the MultiSelect value upon submission, I would recommend using a Kendo Form because you can see the MultiSelect value in the e.model object in the submit event.

submit: function (e) {
                    e.preventDefault();
                    console.log(e.model);
                    
                },

Here is a small example for reference.

Let me know how that would work

Regards,
Martin
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.