View Single Post
Old 09-17-2012, 09:13 PM   PM User | #4
phenem
New to the CF scene

 
Join Date: Sep 2012
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
phenem is an unknown quantity at this point
Hi Acheron,

Are you open to using jQuery, it would make things a bit simpler.

I'll try to show you what VIPStephan means using a jQuery example:

Code:
<h1>Search</h1>

<div id="searchResults">

</div>

<script type="text/javascript">
$(function(){
	
	function getSearchResults(){
		$.post(
			'url-to-my-search.html',
			{'searchQuery':'search-string'},
			function(html){
				//we're now inside the callback				
				//perform actions with data returned from search form
				$('#searchResults').html(html);
				
				//this is where you can put your event for your button
				$('#button').bind('click', function(e){
					getSearchResults();
				});
			});
	}
	
	getSearchResults();
	
});
</script>
Your button will have to be on the page: "url-to-my-search.html"

I just ran into this issue myself the other day, and this is how I resolved it.
phenem is offline   Reply With Quote