Search Results for 'input[value'

Forums › Forums › Search › Search Results for 'input[value'

Viewing 4 results – 11 through 14 (of 14 total)
  • Author
    Search Results
  • #130410

    Trevor
    Participant

    Why not use CSS like this:

    li.sf_file_post_meta_Colors > ul > li > input[value="G"] { .... }​
    

    Anonymous
    Inactive

    Hello,

    I am trying to show some custom content on the search and filter results page when a certain filter is selected. Since the results are loaded with AJAX and the page doesn’t refresh, I am trying to do this with Javascript. With JQuery, I am toggling the display of a div when the filter checkbox changes.

    $(document).ready(function() {
    				var $e_book_info = $('#e-book-info');
    				var $input = $('input[value="e-book"]');
    				if ( $input.is(":checked") ) {
    					console.log('checked');
    					$e_book_info.show();
    				}
    				$('input[value="e-book"]').on('change', function() {
    						$e_book_info.toggle();
    						console.log('toggle switch');						
    					
    				});
    			});	

    The toggle works when the input is clicked once, but if I try to click it again to toggle back, the function fails to execute, but the AJAX is working fine with Search and Filter. My question is, how can I implement this functionality without the filtering and my function getting in the way of each other? I’m assuming something in the Search and Filter JS is blocking my function from running again.

    Thanks for your help!
    Travis

    #23222

    Anonymous
    Inactive

    Hi,

    I have search and filter pro, it’s a wonderful plugin!

    I need to select the filter from the beginning with the value of ‘query var’ from another page.

    I’ve done this:

    
    $value = get_query_var('year');
    ....
    <script>
    $('input[value="<?php echo $value ; ?>"]').click();
    </script>
    

    But this method is far from ideal because first are charged all items then with click event the filter is activated.

    Is there a better method?

    Thanks

    #21609

    Anonymous
    Inactive

    Tnx for the quick reply, I appreciate that.

    i was probably not clear. The checkbox is checked now but the form is not updated with the results. When i hit the submit button, the results are fine. However, I would like to see the results immediately like any other checkboxes/input fields.

    I’ve tried the following:

    (“input[value=’myCheckbox’]”).prop(‘checked’, ‘checked’);
    $(‘input[type=submit]’).click();

    but the the value of the submit is not reflected in the results. It looks like only the submit is processed.

Viewing 4 results – 11 through 14 (of 14 total)
Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.