js实现按下回车键后实现表单提交

//提交查询

jQuery("#query").click(function () {
    if (paramsTest()) {
        $('#mileageResearch').attr("action", "/mileage/list");
        jQuery("#mileageResearch").submit();
    }
});

jQuery(document).bind('keyup', function(e) {
    if (event.keyCode == 13) {
        if (paramsTest()) {
            $('#mileageResearch').attr("action", "/mileage/list");
            jQuery("#mileageResearch").submit();
        }
    }
});

你可能感兴趣的:(js实现按下回车键后实现表单提交)