Problem: Autocomplete and special char
Dear all,
i use Autocomplete with asp script to read a database.
When in the record passed by the asp script there are special char like à the results are not displayed.
This is the code:
- <script>
$(function() {
- $( "#birds" ).autocomplete({
source: "searcher.asp?cosa=articoli",
minLength: 2,
- select: function( event, ui ) {
$('#valore').val(ui.item.id);
}
});
});
</script>
This is the asp script:
- <!--#include virtual="/setup.asp" -->
<%
- Response.AddHeader "Content-Type", "application/json;charset=UTF-8"
'if request("fornitori")<>"" and request("term")<>"" then
if request("term")<>"" then
strArr=""
if request("cosa")="articoli" then
sql="select idpro, ricerca from cerca_articolo where ricerca like '%"&request("term")&"%' order by ricerca;"
set rs=conn.execute(sql)
do while not rs.eof
if strArr<>"" then strArr=strArr & ","
'response.write (rs("idpro")&"###"&rs("articolo")&"|")
strArr=strArr & "{"&"""value"":""" & ""&rs("ricerca")& """, ""id"":" & rs("idpro") & "}"
rs.movenext
loop
end if
Response.Write replace("[" & strArr & "]","à","")
end if
%>
This is a sample of the output
[{"value":"ES--1835 Giacca ANDRE'cuoco uomo Tg. XS/XXXL ( colori bianco polsini colletto stampa quadri)", "id":6487},{"value":"ES--1987 casacca uomo Andrea tg. S-XXL", "id":6482}]
Also this output is not displayed.
Can anyone help me?
Thank's.
I make this page to try: http://www.abitidalavoro.it/prova.asp
If you write "andre" the script return 2 record but not displayed in the autocomplete
In the box there is the output of the asp script, the resfresh is not fast.