Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro Stop loading results on page load

Viewing 3 posts - 1 through 3 (of 3 total)
  • Gabriel Westington
    #191308

    I want only to show the results AFTER user clicks the submit button. Instead it shows results on page load. Is there a way to stop/prevent this?

    Using shortcode method on a template file. Loads results using Ajax.

    Trevor Moderator
    #191321

    As you are using the Shortcode results method, and our results.php template file (infinite scroll version), it would look like this:

    global $searchandfilter;
    $sf_current_query = $searchandfilter->get(1024)->current_query();
    if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()=="")) {
      echo '<div>Nothing to see here folks!</div>'; 
    } else {
      // your template archive code/loop OR results.php code here
    }

    Change 1024 to the ID number of your form (from the form shortcode).

    Gabriel Westington
    #191334

    Thank you! Code works fine.

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Stop loading results on page load’ is closed to new replies.