<fb:typeahead-input/>
<fb:fbml version="1.1"><fb:typeahead-input name="...">... <fb:typeahead-option value="...">...</fb:typeahead-option> </fb:typeahead-input></fb:fbml>
Renders a type-ahead text input box that autodetects what the user is typing and tries to match a drop-down menu of options with what the user is typing. A good example of this can be seen in the search box in the upper-left corner of the Facebook site. At the time of this writing, this tag is currently in beta and therefore requires the <fb:fbml version="1.1"/> tags wrapped around it.
autocomplete=[on|off] default:
on
If on
, allows the browser’s
autocomplete functions to override the autocomplete of the
<fb:typeahead-input/> tag. It is
recommended that you set this to off
to
override the browser functionality.
value=[string
]
default: none
The default value to include in the input box when the page loads. Note that it doesn’t translate to the text of the <fb:typeahead-option/> box it corresponds to.
Here is example FBML code for
<fb:typeahead-input/>
:
<form> <fb:fbml version="1.1"> <fb:typeahead-input name="name" autocomplete="off" value="mark"> <fb:typeahead-option value="jesse">Jesse Stay</fb:typeahead-option> <fb:typeahead-option value="mark">Mark Zuckerberg</fb:typeahead-option> <fb:typeahead-option value="nick">Nick O'Neill</fb:typeahead-option> </fb:typeahead-input> </fb:fbml> </form>
The underlying HTML when rendered looks like this (Figure 3-36 shows the result):
<form> <input type="hidden" name="name_val" id="name_val" /> <input name="name" autocomplete="off" value="mark" class="inputtext" onfocus="var source = new custom_source( [{"i":"jesse","t":" Jesse Stay"},{"i":"mark"," t":"Mark Zuckerberg"},{"i":" nick","t":"Nick O'Neill"}]); source.text_placeholder = null; var ta = new typeaheadpro(this, source, {onselect: function( row) { $("name_val").value = row.i; ; }});"> </form>
Be sure to include this tag within a <form/> tag to have it submit with the form (or use FBJS).
This tag must be included within an <fbml version="1.1"/> set of tags.
This tag is currently under beta at the time of this writing.
If none of the options are selected, the text entered in the input box gets sent back to the form.
3.15.237.164