Send multiple checkbox data to PHP via jQuery ajax()

后端 未结 6 1105
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-28 08:31

I want to submit a POST form that contains a textarea field and an input field(s) (type=\"checkbox\" with an arbitrary/variable number of checkboxes) on my website via jQuer

6条回答
  •  没有蜡笔的小新
    2020-11-28 09:27

    The code you have at the moment seems to be all right. Check what the checkboxes array contains using this. Add this code on the top of your php script and see whether the checkboxes are being passed to your script.

    echo '
    '.print_r($_POST['myCheckboxes'], true).'
    '; exit;

提交回复
热议问题