一个按钮中的两个功能 - 计算和提交表单

时间:2015-03-16 12:59:33

标签: javascript jquery html button onsubmit

我目前正在使用计算器来计算价格值,同时只需点击一下按钮就可以将表单字段提交到我的电子邮件中。使用JavaScript / jQuery和HTML。除了使用mailto之外的任何其他方式:?

计算已使用

go=$('button');

go.click(function(){

    //Bunch of code here

});

通过网络研究没有明确的解决方案,所以我试着在这里问。

1 个答案:

答案 0 :(得分:1)

试试这个......

$('button').click(function(){

    //Bunch of code here to calculate and assign to the html elements
    $('#formId').submit(); // code to submit form by using id or class

});
相关问题