Trigger a function after submitting a form and use the input value

Hello everyone, I need help how can I trigger an event after a gravity form is submitted and use the values from the form? the documentation is not quite clear to me

I’m trying to do something like

jQuery("#gform_1").submit(function () {
var email = jQuery(’#email_input’).val()

// save email for analytics
})

Hi Jim. You can use the gform_submit_button filter for that. There’s an example showing how to append JavaScript here:

Or you could put the script in the confirmation text, or even use the gform_confirmation filter as shown in this example:

Will any of those options work for you?

hi @chrishajer thanks for the quick response! will gform_submit_button can be specified only when the form successfully submits?

I think I would use gform_confirmation in that case - that is only called when the form submission went through successfully.

@chrishajer will this work? should I still add this to functions.php?

any idea how can I access the value from gravity form input field?