Fb:editor

From Facebook Developer Wiki

Jump to: navigation, search

Contents

Description

Creates a form with two columns, just like the form on the edit-profile page. The children of fb:editor specify the rows of the form. For example, an fb:editor-text child adds a row with a text field in the right column. The label attribute of the fb:editor-* child specifies what text appears in the left column of that row.

Warning: This form is submitted via POST method.

Attributes

RequiredNameTypeDescription
required action string The URL to which the form's data is posted. The URL must be relative.
optional width int The width of the second column (not the whole form/table), in pixels. (Default value is 425.)
labelwidth int The width of the first column of the form/table, in pixels. (Default value is 75.). Note: This value cannot be 0 as it is ignored; use 1 instead.

Examples

<fb:editor action="?do-it" labelwidth="100"> <fb:editor-text label="Title" name="title" value=""/> <fb:editor-text label="Author" name="author" value=""/> <fb:editor-custom label="Status"> <select name="state"> <option value="0" selected>have read</option> <option value="1">am reading</option> <option value="2">want to read</option> </select> </fb:editor-custom> <fb:editor-textarea label="Comment" name="comment"/> <fb:editor-buttonset> <fb:editor-button value="Add"/> <fb:editor-button value="Recommend"/> <fb:editor-cancel /> </fb:editor-buttonset> </fb:editor>
fb-editor.png

Notes

  • The action attribute for fb:editor must be a relative URL, if you write the whole address the POST parameters are lost. Facebook appends your canvas callback URL address to the action attribute value.--Ildegardo J Elizondo 12:12, 18 July 2008 (PDT)
  • Mock AJAX: There is currently no way to implement Mock AJAX using fb:editor. In order to use Mock AJAX, you must mimic the HTML equivalent of fb:editor and combine it with Mock AJAX as described at [1].
reference