Radio button filter; reload results in page

flyboeing 14 Dec, 2015
Hello all,

I have a CC to show data from my database. The CC shows all the date from my 'contact' table: when someone uses the contactform, the data is saved in this table. The mysql table has a column called "solved". This column contains the vallues 'yes' and 'no'.

I made a simple filter with radiobuttons with the following options: yes, no and all. By default, the option 'all' is selected (showing all the records...). If the option 'yes' is selected then all the records with solved = 'yes' are shown.
Now I use a submit button to submit my selection.


<input type="radio" name="fltr[contact][solved]" value="yes">Solved
<input type="radio" name="fltr[contact][solved]" value="No">Not Solved
<input type="radio" name="fltr[contact][solved]" value="" checked>Show all
<button type="submit" value="Submit">Submit</button> 


In my 'front list' --> 'settings' --> 'Filters' and 'Searchable' if have contact.solved.

So far it is working very well, but know I want to make the selection (and showing the results) without hitting the 'submit' button. For example, when I select the option 'yes', that the results are automatically loaded in the same page (so without refreshing the page..).

Can someone help me with this?

Regards,
Ruud
GreyHead 21 Dec, 2015
Hi Ruud,

You can try doing it with a little JavaScript. Try this in the listing Header box to test
<script>
jQuery(document).ready(function (jQ) {
  jQ('.gbs3 input:radio').on('click', function() {
    jQ('.gbs3 form').submit();
  });
});
</script>

Bob
This topic is locked and no more replies can be posted.