Skip to main content

Dynamic Reload on Selection Change

Instantly refresh related form elements based on user selection โ€” no page reload required.

What Is It?

โ€œDynamic Reload on Selection Changeโ€ allows you to trigger live form updates when a user changes the value of a select list, radio button, or other interactive input.

When configured, JCB automatically injects the JavaScript logic needed to:

  • Detect changes on a field (controller)
  • Send an AJAX request to retrieve updated options or layout for dependent fields (target)
  • Replace the dependent fieldโ€™s HTML in-place without reloading the full form

This creates dynamic and responsive forms with minimal coding.

Use Cases

  • Reloading the list of subcategories when a user selects a category
  • Showing/hiding specific fields based on type selection (e.g., payment method โ†’ credit card fields)
  • Updating address fields based on country selection
  • Changing filters or report criteria dynamically

Configuration in JCB

  • Create or edit the field you want to be the trigger (controller)
  • Under the โ€œAdvancedโ€ tab, enable Dynamic Reload
  • Specify the target field(s) or areas to reload when this one changes
  • Optionally write custom JS or callback functions to refine behavior

Behind the scenes, JCB adds:

  • onchange event listeners
  • AJAX handlers for fetching fresh field data
  • Replacement logic for the target HTML block

Secure & Controlled

JCB ensures that only allowed data is fetched and rendered using standard Joomla token verification and ACL checks. This ensures your dynamic fields are secure and properly scoped.

Compatibility

  • Works in Admin Views, Custom Admin Views, and Site Views
  • Fully functional in Joomla 3, 4, and 5
  • Compatible with most modern browsers and responsive UIs

Developer Notes

  • The reload is usually performed via an internal JCB AJAX endpoint
  • You can inject your own custom AJAX logic using Snippets or Layouts
  • JS callbacks like onSuccess or onComplete are supported

Why It Matters

  • Improves UX by eliminating unnecessary form reloads
  • Helps reduce user errors by guiding choices step-by-step
  • Adds polish and interactivity to admin tools or frontend submissions

Summary

This feature enables dynamic interactivity in your admin and site forms by automatically reloading dependent fields when a controlling fieldโ€™s value changes.