Placeholder text in geocoder widget

731
4
Jump to solution
10-28-2013 07:48 AM
KaitlynnDavis
Occasional Contributor
I want to put some placeholder text in my geocoder widget so users know what it's there for. I'm pretty sure I followed the instructions for adding a placeholder property...

     var geocoder = new Geocoder({  map: map,  arcgisGeocoder: {   placeholder: "Zoom to a city or address"  } }, "search"); geocoder.startup();


Does anyone see any reason why I still don't see the placeholder text?
0 Kudos
1 Solution

Accepted Solutions
JanelYang
New Contributor III
Yes, this is a known issue at v3.5. It should work fine with other versions. A workaround for v3.5 is to use:
dom.byId("<your widget id>_input").placeholder = "Zoom to a city or address";

Example: http://jsfiddle.net/83QUM/3/

You may also look at previous threads:
http://forums.arcgis.com/threads/87079-placeholder-for-basicviewer?p=307914#post307914
http://forums.arcgis.com/threads/86520-Geocoder-Placeholder-not-working-in-3.5

View solution in original post

0 Kudos
4 Replies
JanelYang
New Contributor III
Which browser are you using? It should work fine with Chrome and Firefox.
0 Kudos
KaitlynnDavis
Occasional Contributor
I tried firefox and Internet Explorer, neither render the text. I am using API version 3.5, if that has any bearing on this property...
0 Kudos
JanelYang
New Contributor III
Yes, this is a known issue at v3.5. It should work fine with other versions. A workaround for v3.5 is to use:
dom.byId("<your widget id>_input").placeholder = "Zoom to a city or address";

Example: http://jsfiddle.net/83QUM/3/

You may also look at previous threads:
http://forums.arcgis.com/threads/87079-placeholder-for-basicviewer?p=307914#post307914
http://forums.arcgis.com/threads/86520-Geocoder-Placeholder-not-working-in-3.5
0 Kudos
KaitlynnDavis
Occasional Contributor
Yay! That worked for me. I appreciate the example and references
0 Kudos