How to get the form title using JavaScript?
-
I’m running some logic on various form submit events, and I do see the
e.detail
object where I can find the form ID, input fields, status, and a few other things, but I’d really love to have access to the form name here.I’ve been sending event data to Google Analytics for various submission statuses, but it’s tough to need to reference the form ID in WordPress every time (more so when needing to send reports to others).
Is there an easy way to get the actual title of the form during one of the JavaScript events such as ‘wpcf7submit’, and ‘wpcf7mailsent’ (for example)? Any REST API tricks that can be done here?
- The topic ‘How to get the form title using JavaScript?’ is closed to new replies.