Autocomplete Processor - json/application error

onlabs 20 Aug, 2012
Hi all,
first thanks for ChronoForm, is a very usefull and powerfull joomla component.

well, i need your help. i'm trying to use the Autocomplete Plugin to create the typical autocomplete field for cities. i created an autocomplete loader with the right parameters for "field id" and "field name". then i created an autocomplete processor that uses a table of the database and that fills the same "field name" of the loader. nothing complicated.
but when i load the page in frontend the result is a blank page with only two brackets "[]". no other error.
the firefox debugger says:
Errore: Non è stata dichiarata la codifica caratteri del documento in testo semplice. Il documento verrà visualizzato con del testo incomprensibile in alcune configurazioni del browser nel caso in cui contenga dei caratteri al di fuori dell'intervallo US-ASCII. La codifica caratteri del file deve essere dichiarata nel protocollo di trasferimento oppure è necessario specificare all'interno del file un byte order mark (BOM) come firma di codifica.
Riga: 0

translated into English (with Google Translate :-P)
Error: There has been declared the character encoding of the document in plain text. The document appears with the text incomprehensible in some settings in the browser if it contains characters outside the US-ASCII. The character encoding of the file must be declared in the transfer protocol, or you must specify the file a byte order mark (BOM) as a signature of coding.
Row: 0

and finally the page is identified as a json/application.

what could be the cause?
thanks to all
Nicola
GreyHead 22 Aug, 2012
Hi Nicola,

It does sound like a problem with the Character encoding of either the web page itself, or possibly the data being returned from the Ajax inquiry. Please check that the page is set to UTF-8 as that seems to resolve most character set problems. The setting should be in the page head block, and is probably set in the template index.php file.

Bob
onlabs 23 Aug, 2012
Thanks for the quick response Bob.

i checked the charset in the page header and it is UTF-8
<meta http-equiv="content-type" content="text/html; charset=utf-8" />

i did the same configuration in another joomla site to verify that the problem was not related to the server or joomla. well, the problem recurs here.
it seems that the json array is not passed in the background (ie with the classical methods used in ajax) but had gone directly to the page. is it possible?

thanks,
Nicola
GreyHead 23 Aug, 2012
Hi Nicola,

I guess that it is possible, normally the function that you call the Ajax with will do something to insert the results in the page. If there is an error in that function or the results are not what is expected then the effect could be to break the page.

You can usually see what is being returned if you check the web developer tools in your browser.

Bob
onlabs 23 Aug, 2012
Hi Bob,
the request header is

GET /index.php/page HTTP/1.1
Host: www.domain.it
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20100101 Firefox/14.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: it-it,it;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
DNT: 1
Connection: keep-alive
Cookie: __utma=202000713.45291335.1345189274.1345189274.1345189274.1; __utmz=202000713.1345189274.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); jpanesliders_panel-sliders=0; 5657fc4b6b6a577dc405dcad0e8d7a59=a0a17b1c6b1b7e2ef6852acd1c409345; ea9c2fbb42247fa4a7f599b7dd69b710=2168f4f8d15a8e589e4914ac910ef59d; jpanesliders_menu-sliders-=0; jpanesliders_menu-sliders-118=0
Pragma: no-cache

and the response header is

HTTP/1.1 200 OK
Date: Thu, 23 Aug 2012 12:54:36 GMT
Server: Apache/2.2.22 (Debian)
X-Powered-By: PHP/5.3.9-1
Content-Length: 2
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: application/json

but the response content is empty, or rather the ajax array is empty. it seems just an error on the code of the Autocomplete Processor Plugin...

you have any ideas or suggestions?
thanks,
Nicola
GreyHead 23 Aug, 2012
Hi Nicola,

An empty Ajax response shouldn't break the page :-(

Please post or PM a link to the form so I can take a quick look.

Bob
onlabs 23 Aug, 2012
I think there is an underlying problem.
yes, i created (i hope in the right way) the AC Loader and Processor, but where do i put them? i had initially placed inside onload event, but it did not work. so now i have tried to place them in a new custom event. result: the page loads, but the autocomplete doesn't work.
now my question is: where do i put the AC Loader and Processor? obviously if the problem is their position...

thanks,
Nicola
GreyHead 24 Aug, 2012
Hi Nicola,

The AutoComplete Processor action has to go into a separate event. Click the Add Event button then give the event a name like 'autocomplete' and put this name into the AJAX Event box of the AutoComplete Loader action.

Bob
This topic is locked and no more replies can be posted.