Hi
My problem is.
I'll break down the problem to make it clear.
<html>
<head>
<body>
<!-- ajax call that opens a jQuery UI Dialog box -->
<a href="#" onclick="$.ajax({beforeSend:function(request){$('#onboarding_accounts').show();}, complete:function(request){$('#onboarding_accounts').hide();}, data:'', dataType:'script', type:'post', url:'/proxy/account/load_create_account?method=get'}); return false;">Create New Account</a>
</body>
</html>
It should be noted that the dialog html is loaded on this ajax call, so the html does not exist on the page until the link and call is made.
Now once this Dialog form has loaded I have an Autocomplete, I have tried just doing the simple default functionality example. The problem is that the autocomplete won't work and I think its because the script binds the autocomplete on document ready.
I need to bind the function once the Dialog box has loaded, what functions are available in jQuery to do this.
Any help will be much appreciated
<script>
$(function() {
var availableTags = [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
"C++",
"Clojure",
"COBOL",
"ColdFusion",
"Erlang",
"Fortran",
"Groovy",
"Haskell",
"Java",
"JavaScript",
"Lisp",
"Perl",
"PHP",
"Python",
"Ruby",
"Scala",
"Scheme"
];
$( "#tags" ).autocomplete({
source: availableTags
});
});
</script>
<div class="demo">
<div class="ui-widget">
<label for="tags">Tags: </label>
<input id="tags">
</div>
</div><!-- End demo -->
<div class="demo-description" style="display: none; ">
<p>The Autocomplete widgets provides suggestions while you type into the field. Here the suggestions are tags for programming languages, give "ja" (for Java or JavaScript) a try.</p>
<p>The datasource is a simple JavaScript array, provided to the widget using the source-option.</p>
</div><!-- End demo-description -->