Prevent sending of remote request if replace returns null

Use case:  We have a typeahead field in which the url replacement pattern is
based on the value of another field. If that other field isn't set, we don't
want to allow the typeahead request to complete. This patch allows our replace
function to return null and prevent the request from being sent.