@

Advanced Conditional Logic

Conditional logic for RSForm! Pro — thirty-one things a form can do in response, not just show and hide

RSForm! Pro can show or hide a field when another field has a certain value. That covers the easy half of conditional logic. Advanced Conditional Logic is an RSForm! Pro extension that covers the rest: setting and calculating values, making fields required, changing classes and inline styles, switching individual dropdown options on and off, and reacting to who's logged in, what time it is, or how many people have already submitted — all built visually, with no JavaScript. And when you do want your own script, one action hands control to it at exactly the right moment.

Advanced Conditional Logic, an RSForm! Pro extension: the visual condition builder with a rule and its ordered list of actions
Conditions on the left, an ordered list of actions on the right. Both are built in the form editor and save as you go.
18 EUR Half a year of updates and support

One rule, read aloud

Every rule is a sentence: if something is true, run these actions; otherwise, run those. This is a real rule from a conference form — the names in the grey boxes are the actions you pick from the builder's list.

If
Ticket type equals VIP
Then
  1. Show Company name
  2. Required Company name
  3. Set value Discount code → VIP10
  4. Disable option Seating → Standing
Otherwise
  1. Hide Company name
  2. Optional Company name
  3. Clear value Discount code
  4. Enable option Seating → Standing

The rule runs again on every keystroke and selection. Actions run top to bottom, in the order you add them.

What it changes

RSForm! Pro's built-in conditions
With Advanced Conditional Logic
RSForm! Pro's built-in conditionsA rule can show or hide a field.
With Advanced Conditional LogicA rule can run thirty-one different actions, in the order you list them.
RSForm! Pro's built-in conditionsA condition looks at what someone typed in another field.
With Advanced Conditional LogicAlso at the time, the submission count, and who is logged in — combined with AND and OR, and matched against patterns with regular expressions.
RSForm! Pro's built-in conditionsA dropdown is all-or-nothing: you can't touch one option.
With Advanced Conditional LogicAdd, remove, hide, disable, tick or select a single option.
RSForm! Pro's built-in conditionsFilling in a value, calculating a total or making a field required needs custom JavaScript.
With Advanced Conditional LogicEach is an action you pick from a list.
RSForm! Pro's built-in conditionsStyling a field by its value means writing CSS and script.
With Advanced Conditional LogicAdd a class or an inline style — and take it off again, restoring whatever was there before.
RSForm! Pro's built-in conditionsHooking your own script to a condition means watching the fields yourself.
With Advanced Conditional LogicYour function is called only when the condition flips between true and false — with the trigger field and the row passed in.

Built for

  • Checkouts Shipping options that appear, disappear or become unavailable depending on what's in the order — and a total that recalculates as it changes.
  • Applications Sections that unlock for a user group, and close once the deadline or the quota is reached.
  • Surveys Follow-up questions that only appear when an answer calls for them — and are only required then.

Try it on a working form

The demo opens on its own page, no registration needed. Change a value and watch fields appear, become required, and have their options switched off in real time.

Open the demo →

How it works

This RSForm! Pro extension adds one new field type to the form builder. Place it in a form and it becomes a rule: a condition on the one side, two ordered lists of actions on the other — one for when the condition is true, one for when it is false. Both are built in the form editor itself, and everything saves as you go, with no page reload.

The builder stays out of your way. When you pick a field to test, the value input turns into a dropdown of that field's actual options; only the operators that make sense for that field type are offered; and only the actions that make sense for the target field appear in the list. When several rules coexist on one form, you set the order they run in.

The visual builder in the form editor: condition types on the left, the ordered action list on the right, and the field and option pickers that populate themselves from the form.

Conditions

A rule can test any of five things. Pick one, or combine several with AND / OR.

What to test

Field value
What the visitor typed, picked or ticked in another field.
Submission count
How many times the form has been submitted — for quotas and limited offers.
Time based
Before, after or between dates, set with a datetime picker.
User based
Logged in, guest, a specific user ID, or a Joomla user group.
Combined
Any mix of the above with AND or OR. Field-value rules inside it update live as the visitor types.

How to compare

equals not equals greater than less than greater or equal less or equal contains not contains is empty is not empty matches regex not matches regex

Only the operators that fit the field are offered. Checkbox groups get contains, because several boxes can be ticked at once; text fields get the regex pair for postcodes, phone numbers and custom formats.

The thirty-one actions

These are the entries in the builder's action list, exactly as they appear there. Each one acts on a field you choose — only the function call can run without one; the example after the dash shows a typical use.

Visibility and state

Show Hide
Toggle a field or a text block — show the company fields for business customers. Fields that should start hidden are hidden before the page paints, so nothing flashes.
Enable Disable
Lock or unlock an input or a button — disable Submit until the terms are ticked.
Required Optional
Switch the mandatory flag, star included — the VAT number is required only for companies.

Values and content

Set value
Write a fixed value into a field. It stays while the condition holds — fill in the early-bird code for the first 100 registrants.
Set default value (editable)
Fill in a starting value that the visitor can still change — put 1 in Number of guests when Bring a guest is ticked. It is written when the condition switches; on page load it only fills an empty field.
Calculate
Work out a value from other fields — {quantity} * {unit_price} * 1.27, recalculated as the visitor types.
Clear value
Empty a field — wipe the card number when the visitor switches to bank transfer.
Set HTML
Replace the content of a text block — a green “Valid postcode” or a grey hint, as the visitor types.

Classes

Add class (input) Remove class (input) Set class (input)
Change the CSS classes of the input itself — add is-invalid while the format is wrong.
Add class (block) Remove class (block) Set class (block)
The same on the whole field row, label included — swap alert-info for alert-warning on a notice.

Inline styles

Add inline style (input) Remove inline style (input)
Apply CSS straight to the input, no stylesheet needed — background-color: #d4edda for a score of 8 or less.
Add inline style (block) Remove inline style (block)
The same on the whole field row. Removing restores the original inline value, and several rules can colour the same field — green, amber, red — without undoing each other.

Single options

Add option Remove option
Change what a dropdown, radio or checkbox group offers — drop the morning slots for premium bookings.
Show option Hide option
Keep an option in the form but out of sight — hide Store pickup for international orders.
Enable option Disable option
Leave an option visible but greyed out — Express delivery stays listed, but can't be chosen when stock is low.
Check option (checkbox) Uncheck option (checkbox)
Tick or untick one box — tick Premium updates for VIP members.
Select option (select / radio)
Pick one choice in a dropdown or radio group — switch billing to Annual for corporate accounts.

Your own code

Call JavaScript function (on state change)
Call a function of yours by name, optionally with an argument — MyApp.onVipChange|ticket to update a map, a chart or an analytics event. It runs when the condition switches between true and false and once on page load, never on every keystroke, and receives the new and previous state, the trigger field and the Repeatable Group row. The function is looked up by name; the plugin never evaluates code strings.

The builder and the engine

The builder

  • Visual editor inside the RSForm! Pro form editor
  • Separate action lists for true and false
  • Auto-save, no page reload
  • Value inputs populate themselves from the field's real options
  • Only the actions and operators that fit the chosen field
  • Duplicate actions flagged as you type
  • Test button: check submission-count, time and user conditions against live data

The engine

  • Re-evaluated on every keystroke and selection
  • Submission count, time and user group evaluated on the server
  • Hidden fields hidden before the first paint, without breaking flex or grid layouts
  • Execution order when several rules share a form
  • Per-row logic inside Repeatable Group Field, combined rules included
  • Custom JavaScript callbacks on state change, tracked per Repeatable Group row
  • Debug logging, plugin-wide or per field
  • Works with validation, multilingual forms and every standard field type

Requirements

Type
RSForm! Pro extension (Joomla package)
Current version
v1.3.61 (2026-11-10)
Joomla
v5.x and 6.x
RSForm! Pro
v3.x or newer
PHP
v8.1
Languages
English, Hungarian
Licence
Half a year of updates and support, renewable

Questions

How is this different from RSForm! Pro's own conditional fields?
The built-in feature shows or hides a field based on another field's value. This extension keeps that and adds twenty-nine more actions, four more kinds of condition, AND/OR combinations and regex matching. If show and hide is all you need, you don't need this plugin.
Where are the conditions evaluated?
Conditions that depend on server data — submission count, time, and the visitor's login and user group — are evaluated on the server when the page loads, so the browser can't fake them. The actions themselves run in the browser, and field-value conditions update live as the visitor types. The plugin doesn't re-check the rules when the form is submitted: for input that must be enforced, keep RSForm! Pro's own validation on the field.
Can I act on one option of a dropdown rather than the whole field?
Yes — that's nine of the thirty-one actions. A single option can be added, removed, shown, hidden, enabled, disabled, ticked, unticked or selected, which is how you build things like a shipping method that stays visible but becomes unavailable.
Can I colour a field by its value?
Yes. Use one rule per range — for example 0–8, 9–14 and 15 and above — each adding its own background with Add inline style (input) and taking it off with Remove inline style (input). The rules don't undo each other, and when none applies, the field goes back to its original style.
Can I fill in a value that the visitor can still change?
Yes. Set default value (editable) writes the value when the condition switches, then leaves the field to the visitor — typing in it doesn't reset it. A value set in RSForm! Pro, or sent back after a failed submission, is kept. Set value is for values that must stay fixed while the condition holds.
Can a rule run my own JavaScript?
Yes. Call JavaScript function (on state change) calls a global function by name — a dotted name such as MyApp.onChange works too — when the condition turns true or false, and once when the page loads so you can set the starting state. It receives a context object with the new and previous state, the trigger and target fields and, inside a Repeatable Group Field, the row. If the function is missing or throws an error, the rest of the actions still run.
Can a rule depend on how many people have already submitted?
Yes. Submission count is one of the five condition types, so a field can change or close once a quota is reached. For closing the whole form on a deadline or a cap, Form Expiry Field is the better fit.
Does it work inside a Repeatable Group Field?
Yes, from version 1.6.2 onwards. Each row evaluates its own rules independently, so a condition in row three doesn't affect row one — and that includes combined AND/OR rules. New and duplicated rows start in the right state without any interaction.
What happens when the licence expires?
The plugin keeps working. You stop receiving updates and support until you renew.

Changelog

1.3.61
  • New action: Set default value (editable) (set_default_value). It writes a value into the target field when the condition switches to the branch that contains the action. After that, the visitor can edit the field freely: typing in it or changing other fields does not reset it. The next time the condition switches to that branch, the value is written again.
  • On page load, the default value is written only into an empty field. A default value set in RSForm! Pro, and the value sent back after a failed submission, are kept.
  • Works per row in Repeatable Groups: each row gets its own default value when its condition switches. A duplicated row keeps the value copied from the original row, and a row restored after a failed submission keeps its restored value.
  • The action is available for text-type target fields: textbox, textarea, calendar and phone number.
  • Set value (set_value) works as before: it is re-applied on every evaluation, so the field keeps the configured value while the condition holds. Use it for values that must not change, and Set default value (editable) for values the visitor may edit.
  • For select, radio and checkbox fields, use RSForm! Pro's own default selection.
  • If the visitor deliberately leaves the field empty and the submission fails, the default value is written again on the error page.
  • No database changes. After updating, clear the Joomla cache.
1.3.60
  • Forms that RSForm! Pro renders after the page head has been built ({rsform N} through the System - RSForm! Pro plugin) get their files in the page head through RSForm's own asset loader, whatever the plugin order.
  • Fallback for forms inserted late by third-party extensions: if a conditional field is on the page but its files are missing, the plugin adds them (CSS before `, JavaScript before ). These tags are marked data-acl-fallback="1"`, and the CSP nonce is supported.
  • Repeatable Group rows restored after a failed submission now keep their checkbox and radio selections, and the per-row rules follow the restored values. Before, depending on which plugin's script loaded first, these selections could be reset to their defaults.
  • user_based rules inside combined conditions now use their own setting (is_guest, is_logged_in, user ID, user group). Before, they used the field's main User Condition, so an is_guest rule was false even for guests. If you built a workaround for this, review it after updating.
  • Condition values YES and NO now work like any other value. Before, RSForm! Pro converted them internally, so such a condition was never met (for example a Yes/No radio group with the values YES / NO).
  • Enable Logging = Yes now writes condition evaluations to the Joomla log (category rsform.conditional). Before, it never switched on.
  • The plugin no longer depends on the Repeatable Group script. From Repeatable Group 1.7.15, that script loads only on pages with a group; on a page with conditional rules but no group, every rule works, call_function included, with no JavaScript errors.
  • If a page optimiser loads conditional.js late (async, or after the page has finished loading), the rules now start as soon as the script runs. Before, they did not start at all.
  • If conditional.js ends up on the page twice, the second copy does nothing, so rules and call_function callbacks don't run twice.
  • conditional.js and conditional-frontend.css load only on pages that display a form with a published Advanced Conditional Logic field, as before. All other pages get nothing from this plugin.
  • Custom CSS or JavaScript that relies on window.ConditionalFieldGroup only finds it on pages with a conditional form. Check before use, e.g. if (window.ConditionalFieldGroup) { … }.
  • If a page optimiser combines or renames JavaScript files, the fallback may add conditional.js once more. This does no harm, but it adds one request; to avoid it, exclude media/plg_system_conditional/ from combining.
  • A popup that opens the form in its own page (tmpl=component, iframe) works. A popup script that inserts the form's HTML into the already loaded page is not supported.
  • Recommended together with Repeatable Group Field 1.7.15 or later.
  • No database changes. After updating, clear the Joomla cache.
1.3.59
  • The Check option, Uncheck option and Select option actions no longer start an endless re-evaluation loop while their condition is true. They now send a change event only when the option's state actually changes.
  • Select option leaves a select list untouched when it has no option with the given value. Before, the list was left with no selection.

László Blahó
My name is László BLAHÓ.
I have been working as a freelancer on films and web works for over 20 years. I have many websites and photography projects to my name. The Studio is based Budapest, Hungary.