Select to view content in your preferred language

Set Placeholder for simpleGeocoder

1134
3
01-11-2013 04:42 AM
DavidRaijmakers
Regular Contributor
I have seen the examples and API Reference.

Only with an arcgisGeocoder it is possible to set an placeholder.

Not with the esri.dijit.geocoder:

var geocoder = new esri.dijit.Geocoder({
          map: map,
          autocomplete: true,
          esriGeocoder: {
            name: "Zoek plaats/straat",
   placeholder: "Zoek Straat/Plaats"  NOT WORKING
           
          }
        },"search");

I also did some element inspector on Google Chrome. Does anyone know how to set the placeholder

<input aria-haspopup="true" id="search_input" tabindex="0" placeholder value="" autocomplete="off" type="text" data-dojo-attach-point="inputNode" data-dojo-attach-event="ondijitclick:_inputClick" role="textbox" style="">
0 Kudos
3 Replies
KevinMacLeod1
Frequent Contributor
I have seen the examples and API Reference.

Only with an arcgisGeocoder it is possible to set an placeholder.

Not with the esri.dijit.geocoder:

var geocoder = new esri.dijit.Geocoder({
          map: map,
          autocomplete: true,
          esriGeocoder: {
            name: "Zoek plaats/straat",
   placeholder: "Zoek Straat/Plaats"  NOT WORKING
           
          }
        },"search");

I also did some element inspector on Google Chrome. Does anyone know how to set the placeholder

<input aria-haspopup="true" id="search_input" tabindex="0" placeholder value="" autocomplete="off" type="text" data-dojo-attach-point="inputNode" data-dojo-attach-event="ondijitclick:_inputClick" role="textbox" style="">



Try putting it in "value". See the "whole enchilada" section on the GitHub page for this dijit https://github.com/Esri/geocoder-search-widget-js/blob/master/resources/media_wiki.txt


Note: we are waiting for a fix for using this dijit where the queried JSON field is something that is not 'SingleLineInput', e.g. Streets, as discussed in detail in the Sample Viewer thread.
0 Kudos
derekswingley1
Deactivated User
The geocoder with suffix sample shows (among other things) custom placeholder text:  http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/#sample/locator_suffix

The mistake in your code is that your using "esriGeocoder" instead of "arcgisGeocoder".
0 Kudos
DavidRaijmakers
Regular Contributor
Yes but i dont want to use the arcgisGeocoder. i just want them to search on a street name. And that is , as far as i know, only possible with esriGeocoder. So my question is if it is possible to set an placeholder for a esriGeocoder
0 Kudos