Rashp Posted February 19, 2025 at 08:02 PM Share Posted February 19, 2025 at 08:02 PM Здравствуйте всем, подскажите пожалуйста кто-нибудь настраивал Dadata в simple? поделитесь кодом js пожалуйста для городов, у меня есть такой, не знаю будет работать или нет var token = " "; var defaultFormatResult = $.Suggestions.prototype.formatResult; function formatResult(value, currentValue, suggestion, options) { var newValue = suggestion.data.city; suggestion.value = newValue; return defaultFormatResult.call(this, newValue, currentValue, suggestion, options); } function formatSelected(suggestion) { return suggestion.data.city; } $("#address").suggestions({ token: token, type: "ADDRESS", hint: false, bounds: "city", constraints: { locations: { city_type_full: "город" } }, formatResult: formatResult, formatSelected: formatSelected, onSelect: function(suggestion) { console.log(suggestion); } }); 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.