Clicking on the radio button, fancybox(modal) will open in that there is search input after typing keyword by pressing search icon calling function myFun() and geeting results to the variable ‘results’ and appedning that to div which have class’pane’.
Issue1: once get the results I am cloing the modal window if again I have clicked on radio button the modal window is showing with existing results, though I have made display:none in afterclose methos of fancybox.
Issue2: Once get the results of the keyword, if again searched the values are appending to the existing one.
<div><input type='radio' id="radioresults" />
<div class="abc-form">
<input type="text" value="" id="searchkey"/>
<div class="pane" style="display:none">
</div>
$('radioresults').fancybox(){
afterclose:function(){$('pane').css('display', none'); $('searchkey').value('') }
}
function myFun(){
$.ajax{
type: GET;
data: $('#searchkey').value();
cache:false;
success:function(data){
$('pane').css('display', 'block');
var results = $('<div/>').addClass('myClass').html(data);
}
$('pane').append(results);
}
}
This is not final code just on high level I had written.