I'm having trouble with the reCaptcha module in the following form. When the page containing the form loads it gets stuck trying read api.recaptcha.net It works in other form though.
function UserProductReviewForm() {
// Create fields
$fields = new FieldSet(
new TextField('Name','Name:'),
new EmailField('Email','E-Mail Address:'),
new TextField('Location','Location:'),
new OptionsetField('Rating','Rating',array(
'1' => '1',
'2' => '2',
'3' => '3',
'4' => '4',
'5' => '5',
)
),
new TextField('Title','Review Title:'),
new TextareaField('Review'),
new RecaptchaField(''),
new HiddenField('ProductID', '', $this->ID),
new HiddenField('ProductName','',$this->Title)
);
// Create actions
$actions = new FieldSet(
new FormAction('doReview', 'Submit')
);
return new Form($this, 'UserProductReviewForm', $fields, $actions);
$protector = SpamProtectorManager::update_form($form, 'ProductID');
if($protector) $protector->setFieldMapping('Name', 'Title', 'Email','Review');
}
using the $recaptchaField = new RecaptchaField('MyCaptcha'); doesn't work for me. It only works if I call it in the form creation