can I implement select_or_other just with core form API? Select (or other) works great but I want know can I implement its functionality with invisible key available for #states attribute described in form API
Yes you can do that with FAPI &amp; #states.

You would do something like this:

$form['options'] = array(
  '#type' =&gt; 'select',
  '#title' =&gt; t('Select'),
  '#options' =&gt; array(
    'one' =&gt; t('One'),
    'two' =&gt; t('Two'),
    'three' =&gt; t('Three'),
    'other' =&gt; t('Other'),
  ),
);
$form['other'] = array(
  '#type' =&gt; 'textfield',
  '#title' =&gt; t('Other'),
  '#states' =&gt; array(
    'visible' =&gt; array(
     ':input[name="options"]' =&gt; array('value' =&gt; 'other'),
    ),
  ),
);


This would make the "other" field visible when the value of the "options" field is "other".

For more info on states see the docs for drupal_process_states()