<fb:friend-selector/>
A special <fb:typeahead-input/> box that renders a form input text box that autocompletes with a drop-down list of friends’ names, which the user can select from. Only one friend can be chosen with this tag. To select multiple friends, use the <fb:multi-friend-input/> tag. This tag can be used inside and out of <fb:request-form/> tags.
uid=[int
] default:
uid of current
logged-in-user
The ID of the user to display a <fb:friend-selector/> input box for.
name=[string
]
default: friend_selector_name
idname=[string
]
default: friend_selector_id
The name of the hidden element within the form
that displays the ID of the selected friend. If used within
<fb:request-form/> tags, do not
change it to anything other than
friend_selector_id
.
include_me=[true|false]
default: false
If true
, includes the
logged-in user in the list of friends to
autocomplete.
exclude_ids=[array
]
default: none
Comma-separated list of user IDs to exclude from the friend’s list. This can be used within an <fb:request-form/> to exclude those friends who have already been invited.
include_lists=[true|false]
default: false
If true
, includes friends
lists in the drop-down list of suggested friends.
Here is example FBML code for
<fb:friend-selector/>
:
<form> <fb:friend-selector name="my_friend" idname="my_friend_id" include_me="true" exclude_ids="4,1,2" include_lists="true"/> </form>
The underlying HTML when rendered looks like this (Figure 3-37 shows the result):
<form> <input type="hidden" name="fb_sig_time" value="1206154647.8097" /> <input type="hidden" name="fb_sig_added" value="0" /> <input type="hidden" name="fb_sig_user" value="683545112" /> <input type="hidden" name="fb_sig_profile_update_time" value="1205994295" /> <input type="hidden" name="fb_sig_session_key" value="54aeab3103ef387539a31aa1-683545112" /> <input type="hidden" name="fb_sig_expires" value="0" /> <input type="hidden" name="fb_sig_api_key" value="ba19d367e2d8c4ea5813d54f2cbba136" /> <input type="hidden" name="fb_sig" value="61014ec6e6d947973c28e2b823127bd2" /> <input name="my_friend" idname="my_friend_id" value="Start typing a friend's name" class="inputtext typeahead_placeholder" maxlength="100" size="25" autocomplete="off" type="input" onfocus="var typeahead_source_instance1= new friend_source( '683545112-1206123558-1&u=683545112&include_me= 1&lists=1');typeahead_source_instance1.set_exclude_ids( {"4":true,"1":true,"2":true}); new FBML.friendSelector(this, typeahead_source_instance1,{ should_use_absolute:1});" /> </form>
18.223.196.146