MIlena
MIlena

Reputation: 257

Implementing facebook registration tool - error

I'm having a problem while implementing facebook registration tool. I've followed the steps described on facebook docs and here is my code:

     <iframe src="http://www.facebook.com/plugins/registration.php?
             client_id=ID&
             redirect_uri=redirect_url&
             fields=  [
 {'name':'name'},
 {'name':'email'},
 {'name':'location'},
 {'name':'gender'},
 {'name':'birthday'},
 {'name':'password',   'view':'not_prefilled'},
 {'name':'like',       'description':'Do you like this plugin?', 'type':'checkbox',  'default':'checked'},
 {'name':'phone',      'description':'Phone Number',             'type':'text'},
 {'name':'anniversary','description':'Anniversary',              'type':'date'},
 {'name':'captain',    'description':'Best Captain',             'type':'select',    'options':{'P':'Jean-Luc Picard','K':'James T. Kirk'}},
 {'name':'force',      'description':'Which side?',              'type':'select',    'options':{'jedi':'Jedi','sith':'Sith'}, 'default':'sith'},
 {'name':'live',       'description':'Best Place to Live',       'type':'typeahead', 'categories':['city','country','state_province']},
 {'name':'captcha'}
]
" scrolling="auto" frameborder="no" style="border: none" allowtransparency="true" width="100%"
            height="330"></iframe>

And I'm facing with this error message:

Unknown name: ' [ {'name':'name'}'. Either switch from CSV to JSON to use custom fields, or check that you spelled the field correctly.

Any help would be really appreciated

Upvotes: 1

Views: 1266

Answers (2)

Mike
Mike

Reputation: 11

I managed to get it working with the iframe after I removed the extra whitespace within the fields parameter. Not sure why.

Upvotes: 1

mitchellhislop
mitchellhislop

Reputation: 445

I think that your error here is that the iFrame cannot take custom fields (as far as I recall). It looks like you copied the code from the sample, and merged it with the set of fields. Whenever I have done this, and in their example, customs fields are use with the XFBML version of the page. For instance, their code (for the fields demo you used) is actually:

<fb:registration class=" fb_iframe_widget" redirect-uri="https://developers.facebook.com/tools/echo/" fields="[ {'name':'name'}, {'name':'email'}, {'name':'location'}, {'name':'gender'}, {'name':'birthday'}, {'name':'password'}, {'name':'like', 'description':'Do you like this plugin?', 'type':'checkbox', 'default':'checked'}, {'name':'phone', 'description':'Phone Number', 'type':'text'}, {'name':'anniversary','description':'Anniversary', 'type':'date'}, {'name':'captain', 'description':'Best Captain', 'type':'select', 'options':{'P':'Jean-Luc Picard','K':'James T. Kirk'}}, {'name':'force', 'description':'Which side?', 'type':'select', 'options':{'jedi':'Jedi','sith':'Sith'}, 'default':'sith'}, {'name':'live', 'description':'Best Place to Live', 'type':'typeahead', 'categories':['city','country','state_province']}, {'name':'captcha'} ]">

I think that your format is correct. Try using the XFBML plugin, and I think that it will work fine.

Upvotes: 2

Related Questions