Post values from a multiple select

前端 未结 2 1997
Happy的楠姐
Happy的楠姐 2020-12-05 03:44

How can I post values from a multiple select in a form? When I hit submit none of the selected values are posted.

2条回答
  •  执念已碎
    2020-12-05 04:10

    try this : here select is your select element

    let select = document.getElementsByClassName('lstSelected')[0],
        options = select.options,
        len = options.length,
        data='',
        i=0;
    while (i
                    
                    0
                  
                       
                    
                   讨论(0)
                  
                                                      
                  
                  
提交回复
热议问题