All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Low serach not working with my ajax..

Nimmy bastian 23 Jun 2014 07:23 question,

I am trying to do ajax submission for my low search but i dont get the data. data is null. can someone help me with this.thanks in advance.my code is below
(function($){
$(function(){
var $form = $('#search_form'), // Search form
$target = $('#results'), // Results container
rp = 'sales-leasing/ajax-search'; // Template for results only

// Function to execute on success
var success = function(data, status, xhr) {
console.log(xhr);
$target.html(data);
};

// Hijack the form on submit
$form.submit(function(){

// Tell target we're loading
$target.html(' Loading...

');

// Add custom result page to data
var data = $form.serialize();
console.log(data);

// Perform the ajax call
$.ajax({
type: 'POST',
url: '/sales-leasing/ajax-search/?XID=74007ee79dc13b0b148ee49f6f1c6770f104f7ce&ACT=25&result_page=%2Fmy%2Fresult_page&site_id=13',
data: data ,
success: success,
dataType: 'html'
});

// Don't submit the form afterwards
return false;
});
});
})(jQuery);

search template
{exp:low_search:form search_mode="any" query="{segment_3}" encode="no" result_page="sales-leasing/ajax-search" form_id="search_form"}

Keywords

Search

{XID_HASH}
{/exp:low_search:form}

{embed="_includes/footer"}

result page
{exp:low_search:results query="{segment_3}" limit="10" parse="inward"}

{if not_ajax}
{if count == 1}

    {/if}
    hgjghjghjghjghjg

    {if count == total_results}
{/if}
{if no_results}No search results{/if}
Query: {low_search_keywords}

{/if}
{if ajax}

{/exp:low_search:results}

Replies

  1. Nimmy bastian 24 Jun 2014 11:37

    some one plz reply

  2. Low 24 Jun 2014 15:21

    This is looking like an implementation issue, rather than an actual issue with Low Search. I offer an Implementation Aid service for a fixed cost for that sort of thing. Just let me know if you are interested in that.