This JavaScript function will add missing form IDs to Avada forms except for search forms.
The algorithm will use the form's parent data-form-id value as the form's ID number. The data-form-id must be set for this code to work properly. This property/value is usually set in the <div></div>
tags that wrap the form.
See the live demo on CodePen.
--
- Copy the contents of the
1029038-avada-forms-ids-readme.js
file. - Paste the contents in Avada > Options > Advanced > Code Fields > Space before
</body>
. This will place the code in the footer of the page. It will not work anywhere else. - Bring up a page that has an Avada form element that didn't have a form ID before.
- Inspect the form element to confirm there is now an ID set that's equal to the data-form-id in the parent
<div></div>
tag above it.