Here is the link to my previous question: passing id name on click using ajax to php
I have three tabs that show ajax based search results on click. How can I refresh a tab(clear search results) when I click any other tab. Say, I have search results in tab-1 and I click tab-2 or three, I want the first tab to return to its initial stage and so on.
I tried slide up and .hide functions but they don't seem to work for this.
Any ideas?
$("input[name='tab-group-1']").click(function() {
if ($("input[name='tab-group-1']:checked").val() == 'tab-1') {
$("#display_results_1").show();
$("#display_results_2").hide();
$("input[name='display_results_2']")
.attr("value", "");
$("#display_results_3").hide();
$("input[name='display_results_3']")
.attr("value", "");
}else if {
($("input[name='tab-group-1']:checked").val() == 'tab-2') {
$("#display_results_2").show();
$("#display_results_1").hide();
$("input[name='display_results_1']")
.attr("value", "");
$("#display_results_3").hide();
$("input[name='display_results_3']")
.attr("value", "");
}
else{
$("#display_results_3").show();
$("#display_results_1").hide();
$("input[name='display_results_1']")
.attr("value", "");
$("#display_results_2").hide();
$("input[name='display_results_2']")
.attr("value", "");
}
});
He probably meant:
function tabrefresh(){
$( "#tabs" ).tabs( "refresh" );
};