Hi All,
Just wondering if its possible to add a query string parameter to gravity forms ajax endpoint so that it will post/get with something like admin-jax.php?param=1
Thanks
Hi All,
Just wondering if its possible to add a query string parameter to gravity forms ajax endpoint so that it will post/get with something like admin-jax.php?param=1
Thanks
Hi GravityDev,
You can definitely add a query string parameter to the Gravity Forms AJAX endpoint.
jQuery(document).ready(function($) {
$(document).on('gform_post_render', function(event, formId) {
// Change 1 to your actual form ID
if (formId === 1) {
var originalAjaxUrl = gform.ajaxurl;
// Add your parameter here
gform.ajaxurl = originalAjaxUrl + '?param=1';
}
});
});
1
to match the ID of your Gravity Form.This code will add ?param=1
to the AJAX request whenever that specific form is submitted.
For more details, please have a look at the following documentation.
Give it a try, and let me know how that goes!