Grab and drag the marker left and right. It will "stick" to the polyline". If you manage to move it off the polyline somehow it should snap to the closest point on the line when you drop it
Extending the jQuery UI autocomplete widget to add a new suggest option. This is a function that can render the autocomplete suggestions outside of the default autocomplete menu.