$('#_Report').keypress(function (e) {
if (enter(e))
{
var action = $('#Form').attr('action'),
separator = action.indexOf('?') == -1 ? '?' : '&',
url = action + separator + $('#Form').serialize(),
post_or_get = 'post';
$.ajax({
url : url,
method : post_or_get,
success : function(data){
// this is the callback :)
}
});
}
});
или вы можете клонировать форму, изменить ее метод с post
на get
и отправить ее:
$('#_Report').keypress(function (e) {
if (enter(e))
{
var post_or_get = 'post';
$('#Form')
.clone()
.attr('method', post_or_get)
.submit();
}
});