How to get multiple selected values of select box in php?

后端 未结 10 1991
既然无缘
既然无缘 2020-11-22 04:18

I have a html form which has a select list box from which you can select multiple values because its multiple property is set to multiple. Consider form method is \'GET\'. T

10条回答
  •  有刺的猬
    2020-11-22 04:52

    I fix my problem with javascript + HTML. First i check selected options and save its in a hidden field of my form:

    for(i=0; i < form.select.options.length; i++)
       if (form.select.options[i].selected)
        form.hidden.value += form.select.options[i].value;
    

    Next, i get by post that field and get all the string ;-) I hope it'll be work for somebody more. Thanks to all.

提交回复
热议问题