This may not be the best way to go about things but I am trying to code up a simple tax calculator via gravity forms.
I have a standard gravityform that records the input values, etc, records the entries and sends appropriate confirmation/thank you emails but then the actual calculation is done manually offline and the customer sent another email with the results.
What i want to be able to do is add the simple calculation logic in some automatic way so that I can cut out the manual process completely.
Rather than code all the form logic manually (i.e. drop gravity completely) and loose all the cool validation, processing, recording and auto emailing that gravity gives me I came upon the idea of adding some javascript that does the calculation on the client before the post is sent and adds the the result to a hidden gravity input field.
Is this possible?
I have copied the source produced by the normal gravityform page into a custom theme template and reproduced the original form page's behaviour (appreciate this is brittle and means the auto gen'd ids could get broken and have to be manually "aligned") but when i try and intercept the submit action with my own javascript or indeed provide my own href based fake submit button and then later call document.forms["gform_6"].submit(); the form doesnt seem to submit properly.
Is this the correct/appropriate way to achieve my use case?
I am presuming that a quick javascript form update would be best.
Is there another way to add some custom logic to the processing flow such that the form gets the calculated value?
I also want to display the form's submitted values back to the user on the confirmation page, I am presuming this is possible using some standard technique?
Thanks for your patience with a java programmer using wordpress and php for the first time!
Greg