V
V
viktorross2019-09-26 18:49:24
PHP
viktorross, 2019-09-26 18:49:24

How to display the city by the first letter in smarti?

hello, please tell me a simple option to display from the database to the input in the smart city template? more precisely, when entering the first letters, suitable options to show, maybe someone has a short ready-made example?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Neverov, 2019-09-26
@TTATPuOT

There is no such solution for Smarty. We need a script that will receive data from the backend via AJAX and display it to the user.
If the list of cities is known in advance, you can display them all in the template, and then display them using JavaScript.
The implementation of both is complete on the web: https://www.w3schools.com/php/php_ajax_livesearch.asp
https://codepen.io/shahjehan/pen/NGWaKq

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question