=== TNT Conditional Logic Fields for Elementor Forms ===
Contributors: palpatel
Tags: elementor forms, conditional logic, elementor, conditional fields, dynamic forms, show hide fields, form builder, smart forms, multi-step form, elementor addon
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Requires Plugins: elementor
Stable tag: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add conditional logic to Elementor Pro forms — show/hide fields, auto-fill values, and build smart forms with zero code.

== Description ==

[**TNT Conditional Logic Fields for Elementor Forms**](https://themesntemplates.com/wordpress-plugins/conditional-logic-fields-for-elementor-forms/) adds conditional logic to Elementor Pro forms directly inside the Elementor editor — no custom code, no external form builder, no separate dashboard to manage.

Long forms that ask every visitor the same questions create a poor experience and lower conversion rates. With Elementor conditional fields, a form shows only the fields relevant to what a visitor has already answered, so a quotation form, booking form, survey, or lead-generation form adapts in real time instead of overwhelming the visitor with irrelevant questions.

https://www.youtube.com/watch?v=M81_wdtX1YQ

= Key Features =

* Show or hide any Elementor Pro form field based on conditions
* Unlimited conditional rules per field, combined with AND / OR logic
* 12 comparison operators in the free version — equals, contains, starts with, ends with, greater/less than, empty, and more
* **Auto-Fill Value** — a field can set its own value automatically when its condition is met, ideal for a hidden field used for lead routing or tagging
* **URL parameter & cookie-based conditions** — trigger a rule from a `?utm_source=` query string or a browser cookie, not only from another field
* Multi-step form support, with hidden steps automatically skipped
* Hidden required fields never block form submission
* Real-time visibility updates with no page reload
* Works with every standard Elementor Pro form field: text, email, number, select, radio, checkbox, acceptance, date, time, upload, and more
* Native Elementor editor integration — conditions live in the same panel as every other field setting

= Why Choose TNT Conditional Logic Fields =

* A genuinely capable free tier — AND/OR logic, 12 operators, multi-step support, auto-fill, and URL/cookie conditions, not a crippled trial
* Lightweight: scripts load only on pages that actually contain an Elementor form, with no external libraries
* Built with agencies and freelancers in mind, for rebuilding similar forms across multiple client sites
* Stays inside Elementor's native UI — no new page builder or dashboard to learn
* A clear upgrade path when you need more: Conditional Redirect, Conditional Email routing, Conditional Submit Button, and Form Field Groups in Pro, using the same interface you already know

= Free vs. Pro =

**Free** includes the complete conditional logic engine described above — show/hide logic, AND/OR rules, all 12 operators, multi-step support, auto-fill, and URL/cookie conditions.

**Pro** adds:

* Conditional Redirect to different URLs after submission
* Conditional Email routing to different recipients based on field values
* Conditional Submit Button visibility
* **Advanced Form Field Groups** — bundle related fields into a group and control the entire group's visibility with a single condition, instead of setting conditional logic on each field one by one. Create as many groups as your form needs, each with its own trigger condition

= Built For =

Agencies and freelancers building client sites, and site owners running contact forms, quotation and booking forms, surveys, event registrations, job applications, product inquiry forms, support ticket forms, and lead-qualification forms — anywhere a form should adapt to what a visitor has already told it.

= Compatible Field Types =

Text, Email, Number, URL, Password, Textarea, Select, Radio, Checkbox, Acceptance, Date, Time, Hidden, HTML, Step, Upload, Honeypot.

== Installation ==

= Quick Installation =

1. Go to Plugins > Add New.
2. Search for **TNT Conditional Logic Fields for Elementor Forms**.
3. Click Install Now, then Activate.

= Manual Installation =

1. Download the plugin ZIP file.
2. Upload it via Plugins > Add New > Upload Plugin.
3. Activate the plugin.

= Requirements =

* WordPress 6.5 or higher
* Elementor, with Elementor Pro (or Hello Plus Form Lite if you're on Elementor's free tier)
* PHP 7.4 or higher

= Getting Started =

1. Go to **TNT Conditional Fields → Features** and enable Conditional Logic.
2. Edit a page with an Elementor Pro Form widget.
3. Open any form field and expand its **Conditions** tab.
4. Enable conditions, choose Show or Hide, and add your rule(s).
5. Publish the page and test the form — the field will show or hide as visitors interact with it.

**Example:** add an "Order ID" text field, then set it to **Show** when **Inquiry Type** *equals* **Order Status** — visitors only see the Order ID field once it's relevant to them.

== Frequently Asked Questions ==

= Does this plugin require Elementor Pro? =

Elementor Pro is required to use Elementor Forms. If you're on Elementor's free tier, install Hello Plus Form Lite to get Elementor-compatible forms.

= How do I show or hide a field based on another field's value? =

Open the field in the Elementor editor, expand its Conditions tab, enable conditions, choose Show or Hide, and add a rule that references the controlling field's ID.

= Can I trigger a condition from a URL parameter or a cookie? =

Yes. Enter `url:param_name` or `cookie:cookie_name` as the condition's Field ID instead of a form field ID.

= Can a field auto-fill its own value when a condition is met? =

Yes, using the Auto-Fill Value option on the Conditions tab. It's most often used to set a hidden field's value for lead routing or tagging.

= What happens to hidden required fields when the form is submitted? =

They're automatically excluded from validation, so a hidden required field never blocks form submission.

= Does it support multi-step forms? =

Yes — hidden steps are automatically skipped, and the Next/Submit buttons adjust to match.

= Which operators are supported in the free version? =

Equals, Not Equals, Greater Than, Less Than, Greater Than or Equal, Less Than or Equal, Contains, Does Not Contain, Starts With, Ends With, Empty, and Not Empty.

= Does it work with dynamic tags? =

Yes, wherever Elementor Forms itself supports dynamic tags.

= Does it slow down my website? =

No. Scripts load only on pages that contain an Elementor form, and there's no measurable admin-side overhead.

= Is it compatible with PHP 8.x and multisite? =

Yes to both.

= My conditions aren't working — what should I check? =

Confirm Conditional Logic is enabled under TNT Conditional Fields → Features, that Elementor Pro is up to date, and that the Field ID in your rule matches the controlling field exactly. Deactivating other plugins temporarily can help rule out a conflict.

= Can I hide multiple fields with one condition instead of setting logic on each field? =

Yes, with Pro's Form Field Groups. Instead of applying field-level conditional logic one field at a time, you bundle multiple fields into a group and control the whole group's visibility with a single condition — hide or show an entire section of the form at once, rather than bulk show/hide field-by-field. You can create unlimited field groups in one Elementor form, each with its own trigger condition.

= What's included in the Pro version? =

Conditional Redirect after submission, Conditional Email routing, Conditional Submit Button visibility, and Advanced Form Field Groups for group-level (rather than field-level) conditional logic.

== Screenshots ==

1. Show or hide Elementor form fields dynamically using conditional logic
2. Display grouped fields dynamically based on user selection
3. Conditional Redirect after form submission
4. Advanced Field Groups builder

== Changelog ==

= 1.2.0 =
* New: Documented Pro's Form Field Groups more thoroughly in the description and FAQ — group-level conditional logic for hiding/showing multiple fields at once, as an alternative to field-by-field rules.
* New: A "Leave a Review" notice now appears on the plugin's own settings page once Conditional Logic has been enabled for at least 7 days. Dismissible, and never shown again once dismissed.

= 1.1.1 =
* Fixed: A condition's comparison value wasn't being HTML-entity-decoded before use (the decode result was computed but never applied), so rules comparing against a value containing `&`, `<`, `>`, or a quote character could silently fail to match. Comparisons now use the correctly decoded value.

= 1.1.0 =
* New: Auto-Fill Value — when a field's condition is met, it can now set its own value (great for hidden fields used for lead routing/tagging), and clears back to empty when the condition stops being met.
* New: URL parameter & cookie-based conditions — a condition's "Field ID" can now be "url:param_name" or "cookie:cookie_name" to build rules off a URL query parameter or a browser cookie instead of only another form field.
* Improved: Updated "Tested up to" to WordPress 7.1 and "Requires at least" to WordPress 6.5.
* Improved: Updated Elementor tested up to 4.2.2 and Elementor Pro tested up to 4.2.2.
* Security: Removed a settings-page routine that suppressed other plugins' admin notices by mutating WordPress internals — it could hide security-relevant notices from unrelated plugins and is no longer needed.
* Security: Restructured the frontend logic-data output so escaping is applied immediately at the point of output (no functional change; hardens against static-analysis false positives).
* Security: `register_setting()` for the Features option now explicitly declares its data type.
* Fixed: The header/readme "Requires at least" value now matches what earlier changelog notes described.

= 1.0.2 =
* New: Added `load_textdomain()` on `init` hook for proper translation loading per WordPress i18n standards.
* Improved: Updated "Tested up to" to WordPress 7.0 and "Requires at least" to WordPress 6.9.
* Improved: Updated Elementor tested up to 4.1.4 and Elementor Pro tested up to 4.1.4 for full compatibility.
* Improved: Added `rel="noopener noreferrer"` to all external `target="_blank"` links for security best practice.
* Improved: Bumped minimum WordPress requirement from 6.0 to 6.9 to align with supported versions.
* Fixed: PHP 8.x compatibility — no deprecated warnings on PHP 8.0, 8.1, 8.2, 8.3, or 8.4.
* Fixed: Asset cache busting now reliably uses the `CLFEF_VERSION` constant across all enqueued files.
* Security: All external anchor tags now include `rel="noopener noreferrer"` per WordPress.org security guidelines.

= 1.0.1 =
* Initial release
* Added conditional logic engine
* Added support for all field types
* Performance improvements

---

== Upgrade Notice ==

= 1.1.1 =
Bug fix: conditions comparing against a value containing &, <, >, or a quote character now match correctly (the decoded value was previously computed but never used).

= 1.1.0 =
Adds Auto-Fill Value and URL/cookie-based conditions, updates compatibility to WordPress 7.1 and Elementor/Elementor Pro 4.2.2, and removes a settings-page routine that could suppress other plugins' admin notices.

= 1.0.2 =
Recommended update. Improves compatibility with WordPress 7.0, Elementor 4.1.4, and PHP 8.x. Adds proper translation loading and strengthens security on external links.

= 1.0.1 =
Initial release of TNT Conditional Logic Fields for Elementor Forms.
