Use typeHead in form for two fields


#1

hello, i am use TypeHead for a form in "origin" and "destination" fields, if reaload page no work but if use console of chrome inspect and type "typeahead($("input[name=origin],input[name=destination]"));" work. what can be?

i try

$( document ).load(function() {
  typeahead($("input[name=origin],input[name=destination]"));
});

but not work. thanks


#2

Hi @Raguel_Lares,

Forms are rendered by the embed code Javascript after the DOM is loaded, so the $(document).load() function might still be firing before the form is fully loaded. I'd recommend using the form's built-in onFormReady callback:


or