I have a simple web application in which I created a wizard, each page of the wizard contains different form fields that are populated from the database, as the user clicks the following page data, is retrieved from the server using an Ajax call. Here is the page code that is retrieved from the server by an Ajax call. I make it easy to understand.
function printAdAlertWizardStep($step)
{
switch($step)
{
case 1:
print "Welcome to alert wizard,...";
break;
case 2:
?>
<table>
<tr>
<td>Keywords</td>
<td>
<input id="nalertkw" name="nalertkw" size="10" type="text">
</td>
</tr>
</table>
<?php
break;
}
}
}
And the Java script code to attach the Autocomplete to keywords text field
$(document).ready(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"
];
$( "#nalertkw" ).autocomplete({
source: availableTags
});
});
, , , $(document).ready() , #nalertkw . , . Jquery-UI, , Ajax?
edit: , ( Ajax) . . , , , Ajax.