Facebook Cookbook - Jay Goldman [76]
value="7">Jul
value="Give me Ice Cream!" />
orCancel
NOTE
It’s worth noting that this XHTML is actually invalid. Challenge your powers of perception and go find the two validation errors! Back? Got ’em? No? OK, I’ll tell you, but only this time. The various select options that are marked as selected should be marked as selected="selected" in XHTML, and the textarea is missing the rows and cols attributes.
Each of the tags within the form has its own set of optional parameters (with the exception of fb:editor-divider, fb:editor-buttonset, and fb:editor-cancel, which are simplicity defined), discussed next.
fb:editor
The fb:editor tags wrap the whole kit and caboodle, defining the start and end of the form. These replace the HTML form tag, so you don’t need to include one in addition to them. Its parameters are listed in Table 6-9.
Table 6-9. Parameters for fb:editor
Name
Type
Default value
Description
action
string
N/A
The URL to post the form to. This is the only required field.
width
int
425
Width of the fields column, in pixels.
labelwidth
int
75
Width of the labels column, in pixels.
Note that the total width of the table will be width + labelwidth, and so it defaults to 500 pixels.
fb:editor-custom
The fb:editor-custom tag is used to insert any valid block of FBML into your form. In the example shown earlier, it’s used to both display some static text in the field column and include a select with ice cream flavors. Its parameter is listed in Table 6-10.
Table 6-10. Parameter for fb:editor-custom
Name
Type
Default value
Description
label
string
N/A
Label to display in the label column.
fb:editor-text
The fb:editor-text tag is equivalent to an HTML . Its parameters are listed in Table 6-11.
Table 6-11. Parameters for fb:editor-text
Name
Type
Default value
Description
label
string
N/A
Label to display in the label column.
name
string
N/A
Name of the control, which will become the variable containing the value in the POST.
value
string
N/A
Default string to put into the field.
maxlength