简体   繁体   中英

Django and Ajax: how can I implement a form text input with suggestions?

When you start typing something in Google search you can see suggested queries below based on what you type. Another example is stackoverflow's Tags line. Is there a simple Django add-on to do this? If not, are there any examples? Thank you.

You don't need any Django add-on to do this. All you need to do is pick a JS library such as typeahead you want to use https://www.google.com.au/?gfe_rd=cr&ei=YXthVMevNMON8Qfs74HABg#q=javascript+autocomplete .

and then write a Django view to return the data for the auto-completion.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM