I’m sorry, I meant my_database_name not my_form_name
Also, I should note that I can’t figure out how to add your [cfdb-save-form-post] to the post url because I am using AJAX to dynamically post (at least I believe, I didn’t write this code and have very little experience with AJAX).
function Calculate_Ft() {
var FormData=jQuery('#frmcalculator').serialize();
jQuery('#calresult').hide();
jQuery.ajax({
type : 'POST',
url : myAjax.ajaxurl,
data : FormData+"&action=ft_calculator",
dataType : "json",
async :false,
success :function(data){
jQuery('#calresult').show();
jQuery('#calresult').html(data.result);
}
});
}
And then in the template file we have:
<form name="frmcalculator" id="frmcalculator" role="form">
<label>Some Inputs Here</label>
<input type="text" name="email" id="email" />
<button type="button" onclick="Calculate_Ft();">CALCULATE</button>
<div class="results">
<div id="calresult">
</div>
</div>
</form>
The ft_calculator() function is defined in the functions file. That is where it is telling the form what database to store in.
-
This reply was modified 9 years, 1 month ago by
htausch.
-
This reply was modified 9 years, 1 month ago by
htausch.
-
This reply was modified 9 years, 1 month ago by
htausch.
The plugin doesn’t support pulling in data from other database tables.
[cfdb-save-form-post] does not work with ajax submissions. But in the code that handles that ajax submitssion, you could add do_shortcode('[cfdb-save-form-post]');
Ok, so reading your documentation and comments further I solved it.
I followed Step One from here.
And then I added the code mentioned here.
Meaning I added this to my function in my functions.php file:
function ft_calculator() {
require_once(ABSPATH . 'wp-content/plugins/contact-form-7-to-database-extension/CFDBShortCodeSavePostData.php');
$handler = new CFDBShortCodeSavePostData;
$handler->handleShortcode(null);
}