How to POST empty <select .. multiple> HTML elements if empty?

后端 未结 8 1926
醉酒成梦
醉酒成梦 2021-02-18 18:09

I have the following multi-select box in a HTML form, where user can select one or more option.

 to your form where the name is the same as for your multiple="multiple" select.


It is unfortunate that browsers do not send empty form parameters for multiple="multiple" selects like they do for non-multiple selects or a normal inputs.

Using a dummy value as proposed in the accepted answer is not a very clean solution.

(This question has nothing to do with jQuery)

提交回复
热议问题