advanced Filter in CMSB editor for list field

5 posts by 2 authors in: Forums > CMS Builder
Last Post: July 10, 2018   (RSS)

By kitsguru - July 4, 2018 - edited: July 4, 2018

This is for CMSB not the front end.

I have province/state table and a country table that are fully populated.

I have fields in my contacts table for the country and prov.

I have set up the province to change when the country changes. The ESCAPED_FILTER_VALUE is the country name.

SELECT name
  FROM `<?php echo $TABLE_PREFIX ?>_sc_provinces`
where country = '<?php echo $ESCAPED_FILTER_VALUE ?>'

When I save the record the province updates to the list for the country selected. However when the country is changed will editing, the province select list does not re-populate. I had the impression that this was to update automatically.

Am I missing something here?

Jeff Shields

By gregThomas - July 9, 2018

Hey Jeff,

You're correct, the page should still refresh the dropdown list, even when you edit it. I've done some testing locally (using version 3.13) using the same code as you've provided along with the Country and province sections and data from Simple Cart and the page refreshed successfully when I edited it.

When you edit the page, do you know if there are any Javascript errors? If you press Ctrl + Shift + J in Chrome any Javascript errors will appear in red in the log. Also, are you running any custom code or plugins on this site? Finally, which version of CMS Builder are you using?

Cheers,

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By kitsguru - July 10, 2018 - edited: July 10, 2018

I'm using CMSB 3.12.

I disabled all plugins except membership and permalinks. No javascript errors. I traced the execution of the javascript code in developer tools and it runs to completion with no errors, yet the list is not updated.

One other thing I did was replace the $ESCAPED_FILTER_VALUE with Canada, and it worked fine. It appears that the ESCAPED_FILTER_VALUE is not being picked up.

Jeff Shields

By kitsguru - July 10, 2018

upgrading to 3.13 made no difference.

Jeff Shields