Dynamic fields and search form - displaying choices post-search

Est. Reading: 1 minute
By: Rob LeVine
Created: 06/05/2023
Category: ,
Difficulty: Intermediate

Dynamic fields and search form - displaying choices post-search

Scenario: You have dynamic checkboxes (multi-select) or radio buttons on your search form and after the search is complete, you want to redisplay the search form with your choices still selected.

Issue: Normally this is easy because you just set the field's default value to [get param="

Dynamic fields in search form - display choices after search

Solution:

  1. In the form settings, I added two new parameters to the URL, one for the ids of the checkboxes and one for the ids of the radio box. When doing this, use the following syntax [125 show="id"] where 125 is the field id.
  2. In the form’s After Fields section, add this jQuery script to use those new parameters and “manually” set the checkboxes and radio buttons. Replace 125 with the ID of your radio button and 124 with the ID of your checkbox. You should also change the variable names so they make sense with your application.

Leave a Reply

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crosschevron-leftchevron-rightarrow-right