I have a simple textbox with JQuery autocomplete inside a div on which I use SimpleModal to make a modal dialogue. The first time the modal dialogue is called, the autocomplete works fine. After the dialogue is closed it completely stops working. Does anybody have any ideas what this could be due to?
Code is as below:
Dialogue html:
<div id="simplemodal">
<div class="content">
<span class="label">国名</span>
@Html.TextBox("NewRegion", "")
</div>
<div class="commands">
<a>追加する</a>
<a class="simplemodal-close">キャンセル</a>
</div>
and the script for the dialogue
/*Show add region dialogue*/
function AddNewRegion(ProjectID) {
$('#simplemodal').modal({
closeHTML: 'simplemodal-close',
closeClass: 'simplemodal-close'
});
}
The autocomplete script
$(function () {
$('#NewRegion').autocomplete({ source: '/Regions/FindRegions' } );
});
I know this has been asked before, but it looks like the question never got answered.