Answer the question
In order to leave comments, you need to log in
How to make city default in KLADR?
Please tell me how to implement the following:
You need to implement a search by default city (the city is determined using ip) and is substituted in the input, and the kladr already works only with the street (you need to search in this city) and the
house
var city = $container_address.find('#input-city'),
street = $container_address.find('#input-street')
city.kladr({
'type': $.kladr.type.city,
'verify': true
});
street.kladr({
'type': $.kladr.type.street,
'parentInput': city,
'verify': true
});
Answer the question
In order to leave comments, you need to log in
Solution:
Immediately initialize:
city.kladr({
'type': $.kladr.type.city,
'verify': true
});
$.kladr.api({
type: $.kladr.type.city,
name: $('#input-city').val()
}, function (obj) {
$('#input-city').kladr('controller').setValue(obj[0]);
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question