Hi ,

I was thinking if it is possible to add captcha to custom login forms which are created through blocks?

We have a login form of our website which is made in a block(using HTML forms and not drupal form API).
Can I add captcha to this form?

Comments

soxofaan’s picture

Category: task » support
Priority: Major » Normal
Status: Active » Closed (won't fix)

I'm afraid you're out of luck: the CAPTCHA module is built on and requires the Drupal form API.
It's not feasible to use with non drupal forms

zahidansari’s picture

I have converted it to drupal form API. Can I add captcha now. If yes how?

zahidansari’s picture

Got it...was pretty easy. This is how it is done.

For eg this is the function which construct your form:

function form_loginform_api_test($formstate){
//all the form attributes eg input types="text " ect
}

After writing this function go to user management-> captcha -> general setting

and give the id of your form. In this case form_loginform_api_test and select captcha type. Click on save