myooomyoo
myooomyoo

Reputation: 145

Two functions in one button - Calculate and Submit form

I am currently working with a calculator that calculates price value and at the same time submit form fields to my email in one button click. Working in JavaScript/jQuery and HTML. Any other way than using mailto:?

Calculation already working with

go=$('button');

go.click(function(){

    //Bunch of code here

});

Got no clear solutions from researching through web so I tried to ask here.

Upvotes: 0

Views: 454

Answers (1)

Sarath Kumar
Sarath Kumar

Reputation: 2353

try this...

$('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

});

Upvotes: 1

Related Questions