Name

<fb:multi-friend-input/>

Synopsis

<fb:multi-friend-input/>

Renders a form input text box that produces a drop-down list of suggestions for friends as the user types. The difference between this tag and the <fb:friend-input/> tag is that this one allows the user to select multiple friends. The tag produces an array in the POST variables with a list of user IDs that the user selected. The submitted form returns an Array of id[] variables.

FBML-Specific Attributes

Required

None.

Optional

width=[string] default: 350px

The width of the field.

border_color=[string] default: #8496ba

The color of the border.

include_me=[true|false] default: false

If true, includes the logged-in user in the list of friends from which to select.

max=[int] default: 20

The maximum number of friends that can be selected.

exclude_ids=[array] default: none

A comma-separated list of friends to be excluded from the list. This can be useful when used within <fb:request-form/> tags to exclude users who have been invited.

prefill_ids=[array] default: none

A comma-separated list of friends to include as already selected in the selector when the page loads. This cannot be used in <fb:request-form/> tags.

prefill_locked=[true|false] default: false

When true, prevents editing of the preselected prefill_ids IDs. The user also cannot add other users.

Example FBML

Here is example FBML code for <fb:multi-friend-input/>:

<form>
<fb:multi-friend-input width="400px" border_color="#000" 
    include_me="true" max="30" exclude_ids="4,1,2,3" 
    prefill_ids="683545112"/>
</form>

Rendered HTML for Single Instance of Tag

The underlying HTML when rendered looks like this (Figure 3-38 shows the result):

<form>
  <input type="hidden" name="fb_sig_time" value="1206158663.8048" />
  <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="942c93c1b92f36b878b3dbe2c46ea16f" />
  <div style="padding-right:3px; width:400px;border:1px solid #000" 
      class="clearfix">
    <div tabindex="-1" id="ids" class="clearfix tokenizer">
      <span class="tokenizer_stretcher">^_^</span>
      <span class="tab_stop"><input type="text" /></span>
    </div>
    <script type="text/javascript">
      onloadRegister(
        function() {
          var typeahead_source_instance2=new friend_source(
            '683545112-1206123558-1&u=683545112&include_me=1'
          );
          typeahead_source_instance2.set_exclude_ids(
            {"4":true,"1":true,"2":true,"3":true});
          var tok = new tokenizer(
            ge('ids'), typeahead_source_instance2,true,30);
          new token(
            {i:'683545112',t:'Jesse Stay',np:true}, tok);
          (new Image()).src='http://static.ak.facebook.com/inbox/images/
               token.gif';(
            new Image()).src='http://static.ak.facebook.com/inbox/images/
                 token_selected.gif';(
              new Image()).src='http://static.ak.facebook.com/inbox/
                   images/token_hover.gif';(
                new Image()).src='http://static.ak.facebook.com/inbox/
                     images/token_x.gif';})
      </script>
  </div>
</form>
The result of our <fb:multi-friend-input/> example
Figure 3-38. The result of our <fb:multi-friend-input/> example

Additional Information

  • When used in a Mock AJAX form, only the last ID in the Array of id[] variables gets returned.

  • This tag disables the friend input box when used on the same page as an <fb:share-button/> tag.

  • Only one of these tags can be used on a page.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.162.49