I am trying to add placeholder text to the Cartodb searchbox using the following DOM code

document.getElementsByClassName('text')[0].placeholder='Search Your Constituency';

It actually does not seem to work.

  • What happens when you try? Nothing? Could you elaborate a bit on what you have tried to do in order to solve it? – Martin Apr 3 '14 at 8:37
  • It is working but when I create a visual and embed the iframe, it is not working. and also I am not able to view the map. here is what I am seeing. goo.gl/Psq2lu – Venkateshwaran Selvaraj Apr 3 '14 at 9:29

Seems like you added code within the infowindow template, unfortunately it breaks the visualization. If you remove it the map will work.

Also, If you want to add or customize something in the map (javascript, styles, etc), I encourage you to try CartoDB.js library (https://github.com/CartoDB/cartodb.js). Create your map using a viz.json url and then change whatever you need :).

Hope it helps you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.