Problem with autocomplete and modal...
Hello, I've got a big issue using Jquery Autocomplete with modal.
the following code works good if not used in modal :
- function showDialog()
- {
- $("#client-modal").dialog({
- width: 850,
- height: 400,
- modal: true,
- })
- };
-
-
-
- $('#cp').autocomplete({
- source: function( request, response ) {
- $.ajax({
- url : 'ajax.php',
- dataType: "json",
- method: 'post',
- data: {
- name_startsWith: request.term,
- type: 'country_table',
- row_num : 1
- },
- success: function( data ) {
- response( $.map( data, function( item ) {
- var code = item.split("|");
- return {
- label: code[0] + " - " + code[1],
- value: code[0],
- data : item
- }
- }));
- }
- });
- },
- autoFocus: true,
- minLength: 0,
- select: function( event, ui ) {
- var names = ui.item.data.split("|");
- $('#cp').val(names[0]);
- $('#ville').val(names[1]);
- }
- });
so the script works good when used out of the modal, but when I use it with the modal, nothing happen ;/
Can some one help me please?
Thank you very much.