Using autoComplete in a dialog

Using autoComplete in a dialog

I want to use autocomplete on an input field in a dialog.

The script is working fine, but I have some display problems.

My Code:

  1. function lookup(inputString) {
            if(inputString.length == 0) {
                // Hide the suggestion box.
            } else {
                $.post("/jquery/autoComplete/rpc.php", {queryString: ""+inputString+""}, function(data){
                    if(data.length >0) {
        } // lookup
        function fill(thisValue) {
            setTimeout("$('#suggestions').hide();", 200);
        <div style="display:none" id="dialog1" title="Dateibeschreibung bearbeiten">
            <form id="dateidesc1" action="" method="post">
                <input class="inputh2" name="empfaenger" value="Spiele durchsuchen" onFocus="this.value=this.value=='Spiele durchsuchen'?'':this.value" onBlur="this.value=this.value==''?'Spiele durchsuchen':this.value; fill();" id="inputString" onKeyUp="lookup(this.value);"/>
                <div class="suggestionsBox" id="suggestions" style="display: none;">
                    <div class="suggestionList" id="autoSuggestionsList">
    &nbsp;                </div>
                <textarea name="beschreibung" class="inputh"></textarea>
                <input type="submit" class="buttonabsenden" name="editbeschreibung" value="" />
        <script type="text/javascript">    
      $(document).ready(function() {
            var $dialog = $('<div></div>')
                    autoOpen: false,
                    title: 'Nachricht schreiben',
                    width: 500,
                    height: 265,

            $('#openmsg').click(function() {

The dialog is working fine, also Firebug tells me that the data is transferred successfully. It only works outside the dialog. But in the dialog, the results aren't showing up.

What is my mistake?

Thank you :)