我有一个表格:
Check this if you Want to receive our newsletter: <input type="checkbox" id="newsletter " name="newsletter">
我通过 javascript/jquery 函数提交它。
在 js 文件中,在提交函数中,我得到了值:
var newsletter = $("#newsletter").val();
其余的 fom 值与 $.ajax 一起通过 POST 发送到我的 php 文件。
问题是:时事通讯的价值始终处于“开启”状态。
如果选中复选框,如何获取一个值,如果未选中,如何获取另一个值?
非常感谢!!