How to use Drupal Captcha in Custom form? Creating nodes can take a long time. That is why for one specific part of my site, I have created my own custom form. The problem is, I want to use the captcha plugin so I don't have to get another separate module for that.

How can I use the Captcha module PROGRAMATICALLY so that I don't need a separate libary?
From looking at the code in the Captcha module, it looks like Captcha defines a new form element.

So an example would look like:

$form['name'] = array(
  '#type' =&gt; 'textfield',
  '#title' =&gt; t('Name'),
);
$form['captcha'] = array(
  '#type' =&gt; 'captcha',
  '#captcha_type' =&gt; 'captcha/Math',
);


Where captcha/Math is the module that provides a type of captcha, followed by the type of captcha to use.