开发者

How to convert multi select form field with GET tto have propper URL?

开发者 https://www.devze.com 2023-02-03 10:54 出处:网络
<select name=\"channel[]\" multiple=\"multiple\"> <option value=\"pants\">Pants</option>
<select name="channel[]" multiple="multiple">
    <option value="pants">Pants</option>
    <option value="tshirts">T-Shirts</option>
    <option value="sweats">Sweats</option>
</select>

So, form is GET, and if I select multiple, and when I click on submit URL is like:

?channel[]=pants&channel[]=tshirts

I need it to be like:

开发者_StackOverflow中文版
?channel=pants+tshirts


This cannot be achieved with an HTML only form. You'll have to incorporate javascript to manipulate the value of channel.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号