I have my Search widget defined as
var searchTool = new Search({
map: map,
allPlaceholder: "Find address or ZIP"
}, dom.byId('searchDiv'));
The placeholder seems to be ignored, it still says "Find address or place" which is the default. The majority of my users don't understand they can use this field to search by ZIP code, so I need to change this.
It seems like this used to say simply placeholder, not allPlaceholder in previous versions.
Solved! Go to Solution.
Tracy,
That only works when you have more than one source for the Search widget. If you are only working with one source then you have to modify the default localization string:
require([
"esri/map",
"esri/dijit/Search",
"dojo/i18n!esri/nls/jsapi",
"dojo/domReady!"
], function (Map, Search, esriBundle) {
esriBundle.widgets.Search.main.placeholder = "blah";
var map = new Map("map", {
basemap: "gray",
center: [-120.435, 46.159], // lon, lat
zoom: 7
});
var search = new Search({
map: map
}, "search");
search.startup();
});
Tracy,
That only works when you have more than one source for the Search widget. If you are only working with one source then you have to modify the default localization string:
require([
"esri/map",
"esri/dijit/Search",
"dojo/i18n!esri/nls/jsapi",
"dojo/domReady!"
], function (Map, Search, esriBundle) {
esriBundle.widgets.Search.main.placeholder = "blah";
var map = new Map("map", {
basemap: "gray",
center: [-120.435, 46.159], // lon, lat
zoom: 7
});
var search = new Search({
map: map
}, "search");
search.startup();
});