[Plugin: Events Manager] Ajax on search page
-
Is it just me or is the ajax function not working correctly? When you perform a search the page always gets refreshed.
Referring to the below in events-search.php
$('.em-events-search-form').submit(function(){ if( this.search.value=='<?php echo $s_default; ?>'){ this.search.value = ''; } if( $('#em-wrapper .em-events-list').length == 1 ){ $(this).ajaxSubmit({ url : EM.ajaxurl, data : { _wpnonce : '<?php echo wp_create_nonce('search_states'); ?>', action : 'search_states', country : $(this).val(), return_html : true }, beforeSubmit: function(form) { $('.em-events-search-form :submit').val('<?php _e('Searching...','dbem'); ?>'); }, success : function(responseText) { $('.em-events-search-form :submit').val('<?php _e('Search','dbem'); ?>'); $('#em-wrapper .em-events-list').replaceWith(responseText); } }); } });
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘[Plugin: Events Manager] Ajax on search page’ is closed to new replies.