serialize () or val ()?
1 answer
If through AJAX then
$.ajax({ url : url, type : 'post', data : $('form').serialize(), success : function(data) { // получаем ответ в <div id="response"></div> $('#response').html(data); } });
If there is a select or radio in the form, then it will not be possible to send via .val (). If you just need to initiate the request, then
$('form').submit();
If there is no jQuery then
window.form[0].submit();
|