Có cách nào để sử dụng javascript và JQuery để thêm một số trường bổ sung được gửi từ biểu mẫu HTTP bằng POST không?Làm cách nào để thêm các trường bổ sung để tạo trước khi gửi?
Ý tôi là:
<form action="somewhere" method="POST" id="form">
<input type="submit" name="submit" value="Send" />
</form>
<script type="text/javascript">
$("#form").submit(function(eventObj)
{
// I want to add a field "field" with value "value" here
// to the POST data
return true;
}
</script>
bản sao có thể có của [jQuery - thêm thông số bổ sung khi gửi (KHÔNG ajax)] (http://stackoverflow.com/questions/2530635/jquery-add-additional-parameters-on-submit-not-ajax) – Marijn