problem in fb:request-form - facebook

In the my facebook app i m using fb request form there i want to know that user has send friend request to any one or just skip the page.
code is
<fb:serverFbml width= "620" style="float:center">
<script type="text/fbml">
<fb:fbml>
<fb:request-form
action='<?php echo $config["base_url"]."?action=3;?>'
target="_top"
method="POST"
invite="true"
type="....some thing"
content="...some thing"
>
<fb:multi-friend-selector target="_top"
showborder="false"
actiontext="----" rows='4' cols='4' max='1' import_external_friends = "false">
</fb:request-form>
</fb:fbml>
</script>
</fb:serverFbml>
as the developer document says that if user either send the request or skip the request page it will go to action URL . Is there any thing to differentiate between these two case.
Please ignore any English grammar mistake.
Thanks in Advance.

The information you're looking for is most likely included in the server response, check it.
Btw, FBML is going to be deprecated very soon, so if this is a new application, you better switch to the JavaScript SDK.

Related

facebook friend selector

Hi
I am working on an iframe based facebook application, I want to develop an auto complete friend selector, but I think it is already provided by facebook? So is that already exist or I need to use JQuery autocomplete? In any case please tell that what facebook provides to developers? What is the best way to do that?
Take a look here. You will find many examples including friend selector, and you can run them from your browser
There also exist two JQuery Plugins you might be interested in. The first is an autocomplete plugin which includes a Facebook theme and the second is a full friend selector plugin. I already used both on production:
http://loopj.com/jquery-tokeninput/demo.html (see the facebook theme)
http://labs.thesedays.com/blog/2011/06/20/the-missing-facebook-interface-component-for-friend-selection/
Friend selector still exists - albeit rather clunky - Check out serverFbml which serves as a wrapper of the legacy friend-selector
Example:
<fb:serverFbml style="width: 755px;">
<script type="text/fbml">
<fb:fbml>
<fb:request-form
action="<URL for post invite action, see fb:request-form docs for details>"
method="POST"
invite="true"
type="XFBML"
content="This is a test invitation from XFBML test app
<fb:req-choice url="see fb:req-choice docs for details."
label="Ignore the Facebook test app!" />
">
</fb:request-form>
<fb:multi-friend-selector
showborder="false"
actiontext="Invite your friends to use Facebook." />
</fb:fbml>
</script>
</fb:serverFbml>

Redirection is not happening correctly after sharing an app usign the multi-friend-selector

I'm using the facebook multi-friend-selector in my facebook page which is loading all my friends in an iFrame. But after selecting a friend from the list and sending an invitation then redirection is not happening correctly to the corresponding callback URL.
I just struck up with this issue, can anybody please help me to fix this issue.
My code for the multi-friend-selector is:
<fb:serverfbml>
<script type="text/fbml">
<fb:fbml>
<fb:request-form action="http://gelofactory.com/dev/SPIN/SXSW/share.php" method="POST" invite="true" type="Download" content="Sharing">
<fb:multi-friend-selector showborder="false" bypass="cancel" email_invite="false" import_external_friends="false" actiontext="Share with your friends." cols="3" rows="3" />
</fb:request-form>
</fb:fbml>
</script>
</fb:serverfbml>
Thanks,
Siva
Are you getting any errors? anyway, here are some suggestions:
Please consider using the new Requests Dialog
Make sure you are using the Canvas URL in the action parameter: http://CANVAS_URL/path/to/share.php

jQuery UI and invite form

I am using the following invite code on my facebook app:
<fb:serverFbml>
<script type="text/fbml">
<fb:fbml>
<fb:request-form
action='http://localhost:8080/home'
method='POST'
invite='true'
type='MyApp'
content='Click here'
<fb:multi-friend-selector
actiontext="Invite your friends to join">
</fb:request-form>
</fb:fbml>
</script>
</fb:serverFbml>
It works fine when I am using it inside a DIV, but if I try to use jQuery UI and turn the DIV into dialog(), when a user opens the dialog it is empty (the fb:serverFbml tag does not generate the invitation form).
Has anyone encountered this issue?
Thanks,
Joel
I think it won't work.
The quick and dirty solution is: use an iframe instead of a div.
Which platform you are using??(Iframe or FBML??)
I am also facing the same problem. Then i shift to fbml application and use FB:Dialog to do the same and I got it working..

Facebook FBML issue - req-choice required as part of request-form content?

When I try to send invitations from my site, I am getting this error, "req-choice required as part of request-form content". What does it mean?
These are the details I gave when I created application:
App. Name : mysitename
ConnectURL: http://www.mysite.com/
Below is the code I am using. Am I missing something?
<fb:serverfbml style="background-color:#F7F7F7;">
<script type="text/fbml">
<fb:fbml>
<fb:request-form
action='http://www.mysite.com/confirm.php'
method='POST'
invite='true'
type='mysite'
content='Come and join us. Visit us at http://www.mysite.com/'
<fb:req-choice url='http://www.mysite.com/' label='Join'/>
<fb:multi-friend-selector
showborder='false'
actiontext='Invite your friends to join'
rows='4'
/>
</fb:request-form>
</fb:fbml>
</script>
</fb:serverfbml>
I believe your tag attributes are a bit out of order. The content attribute of an fb:request-form is a string that should contain the fb:request-choice tag. The best way to do this is to use double-quotes around the content attribute value, and single quotes for everything inside that. You need to re-organize your code like this:
<fb:request-form
action="http://www.mysite.com/confirm.php"
method="POST"
invite="true"
type="mysite"
content="Come and join us. Visit us at http://www.mysite.com/
<fb:req-choice url='http://www.mysite.com/' label='Join'/>
"
>
<fb:multi-friend-selector
showborder="false"
actiontext="Invite your friends to join"
rows="4"
/>
</fb:request-form>
Note how the fb:req-choice tag is actually inside the content attribute string.

Facebook, iframe app, fb:request-form, action attribute problem

I'm making a facebook iframe application
I'm making a request form with my own form data. What should I do in order to process the data?
If I put action="http://apps.facebook.com/[appName]/abc.php" , i.e.
<fb:serverfbml>
<script type="text/fbml">
<fb:fbml>
<fb:request-form action="http://apps.facebook.com/[appName]/abc.php" method="post" type="abc" content="abc">
<textarea name="pm" fb_protected="true" ></textarea>
<fb:multi-friend-selector showborder="false" max="35" actiontext="test" email_invite="true" bypass="cancel" />
</fb:request-form>
</fb:fbml>
</script>
</fb:serverfbml>
Then the result is funny... A facebook page inside the facebook app's iframe !
but if I put action="http://[my own domain / facebook connect url]/abc.php" , i.e.
<fb:serverfbml>
<script type="text/fbml">
<fb:fbml>
<fb:request-form action="http://[my own domain / facebook connect url]/abc.php" method="post" type="abc" content="abc">
<textarea name="pm" fb_protected="true" ></textarea>
<fb:multi-friend-selector showborder="false" max="35" actiontext="test" email_invite="true" bypass="cancel" />
</fb:request-form>
</fb:fbml>
</script>
</fb:serverfbml>
Then the result page will be rendered WITHOUT facebook template (that means losing all top facebook banner and bottom facebook bar like the facebook chats etc)
Anyone knows what's wrong?
Thanks a lot for reading
The key to the target="_top" is that you have to place it on both the request form and the multi-friend-selector in order for it to work on submit and cancel, respectively.
The request-form needs target="_top" so that the form will load in the top frame when submitted, but the cancel functionality is controlled by the multi-friend-selector, not the request-form. Ergo, you need target="_top" on the multi-friend-selector as well so that the cancel action will load in the top frame.
Now, I just wish Facebook would allow a "none" action for cancel that would just hide the frame...
NEW Answer:
Facebook has started phasing out FBML and is strongly encouraging developers to switch to Requests 2.0. Using the new FB.ui({method:'apprequest',...}); in the JavaScript SDK is an easier way to do this. It also supports off-Facebook pages http://af-design.com/blog/2011/02/17/using-facebook-requests-to-promote-a-website/
OLD Answer:
I found that passing the FBML as an attribute for fb:serverfbml worked.
<fb:serverfbml fbml=" {HTML Escaped FBML Here} " ></fb:serverfbml>
I posted about my findings here: http://af-design.com/blog/2010/11/23/fbserverfbml-on-canvas-iframe/
The way I handled this was to have my form processor page emit no output except an "< fb:redirect >" that pointed back to the main app.
How did you use this < fb:redirect > ?
ok I found it try adding target="_top"
http://apps.facebook.com/myapp' label='Join Now' />"
action="http://apps.facebook.com/myapp"
target="_top"
invite="true">