This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Radio Button Checked State Styling

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Radio Button Checked State Styling Reply To: Radio Button Checked State Styling

#33509
vbrains54vbrains54
Participant

Hi Ernest,
Yes, removing that line fixed it and it is working great!
Thank you very much for your assistance!

I have just another quick question:
How would you go about preselecting the first option on those pills to show the user that the filter is active when they first land on the page?

I have added `add_action(‘wp_footer’, ‘wp_footer_add_js_button_class_first_selected’);
function wp_footer_add_js_button_class_first_selected() {
?>
<script>
(function(){
document.querySelectorAll(‘label.asp_label’)[0].classList.add(‘asp_label_selected’);

}())
</script>
<?php
}`
but for some reason, the first click on the filter is not recognized and only the second click activates the filtering functionality.

I would love to be able to fix that and have the first filter option selected by default ( with the new “selected” style applied). But even if it’s not possible it’s all good!

Thank you once again, Ernest!

Kind regards,
Viktor B.