Cartodb search by column

I'm trying to implement a search box that uses my CartoDb data? My current code does not work.



My Map


function processFormData() { var input = document.getElementById("select-place").value; return input; } function main() { cartodb.createVis('map', '', { title: false, description: false, tiles_loader: false }) .done(function(vis, layers) { var userInput = processFormData(); var sql = new cartodb.SQL({ user: 'testuser' }); sql.getBounds("select * from testdb where name like ='%userInput%'").done(function(bounds) { map.fitBounds(bounds) }); var subLayer = layers[1].getSubLayer(0); createSelector(subLayer); }) .error(function(err) { console.log(err); }) } window.onload = main;

That code can't work, you need to put the logic on using the SQL API on the function called by the submit button (processFormData) and thatcreateSelectorcall is not defined anywhere.