HTML submit multiple values through one check box?

后端 未结 3 1150
梦如初夏
梦如初夏 2021-01-06 03:48

Hello I have a form that allows the user to check as many options as they like and then hit submit. Is there any way to have the input type \'checkbox\' submit more than one

3条回答
  •  無奈伤痛
    2021-01-06 04:20

    I found a way to do this without JavaScript or Libraries using a hidden form-field instead:

    
    
    

    Now, if the checkbox is not selected, the hidden value is sent, if it is selected, the hidden value is overridden.

提交回复
热议问题