Hi Jose,

Thanks for you reply.

Following your suggestion, and making one adjustment:

return dict(suggestions=json.dumps(countries))

the controller/function jsonsource/name_autocomplete now returns a correct 
list:

["first_option", "second_option", "third_option"]


In layout.html before the closing body selector I've got:

<script type="text/javascript">
$(document).ready(function() {
  $(function() {$("#dummy_table_name").autocomplete({serviceUrl: 
"{{=URL('jsonsource', 'name_autocomplete')}}", minChars: 2});});
});
</script>


When typing some name in the auto complete field I get the following error:

Uncaught SyntaxError: JSON.parse: unexpected character at line 1 column 1 
of the JSON data
    jQuery 6
        d    
    currentRequest
    c
    fireWith
    l
    o


When I use a local look up like this:

<script type="text/javascript">
$(document).ready(function() {
  var suggestions =  ["first_option", "second_option", "third_option"]
  $(function() {$("#dummy_table_name").autocomplete({lookup: suggestions, 
minChars: 2});});
});
</script>

the autocomplete works, however, I need the ajax lookup, I hope you can 
help me
solve this one last issue.


Kind regards,

Annet


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/b772bf5e-4c8f-416c-95b1-aeb737f34ae2o%40googlegroups.com.

Reply via email to