Using a radio button form to show/hide list items

4 posts by 2 authors in: Forums > CMS Builder
Last Post: March 10, 2016   (RSS)

By JeffC - March 9, 2016

I have a field named 'sponsored page' that is checkbox field type in my cms.

Checked Value is Yes

Unchecked Value is No

The default value is Unchecked.

I would like to use bootstrap toggle radio buttons to select whether sponsored links are shown/not shown on a list page.

Below is what I have so far. The toogle buttons are displaying, but currently they do not have any affect when selected

<form method="POST" action="<?php echo $_SERVER['PHP_SELF'] ?>">
<div class="btn-group marginBottom" data-toggle="buttons">
<label class="btn btn-default  active">
<input type="radio" name="sponsored_page" id="option1" value="1" autocomplete="off" checked>
Show sponsored pages </label>
<label class="btn btn-default ">
<input type="radio" name="options" id="option2" value="0" autocomplete="off">
Hide sponsored pages </label>
</div>
</form>

Jeff

By Damon - March 9, 2016

Hi Jeff,

Are you trying to do this on the frontend of the site or within CMS Builder?

Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By Damon - March 10, 2016

Hi Jeff,

The first step is to get the page filtering correctly before using the bootstrap radio buttons.

Does this URL query just show records with the sponsored_page field checked?
http://example.com/page.php?sponsored_page=Yes

The next step is to create a simple search form with a regular checkbox and submit button to pass that URL to the page, both checked and unchecked.

The results can then be filtered using a MySQL query.

Can you take a look at these steps and let me know where you are in the process and what questions you have?

Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/