How to add tabs to a form without a module I want to add horizontal tabs (not vertical tabs as shown in examples) as shown on the site : http://www.nseindia.com/ (Get Quotes on the top). I tried using menu modules like superfish and nice menu's it didn't solve my purpose. 

I want to add this form with tabs via code and this is what I'm using for adding form to my block:

/**
 * Create the form.
 */
function getQuotes_search_block_form($form, &amp;$form_state) {
  $form['keys'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; 'Get Quotes',
    '#default_value' =&gt; t('Enter Script name/Code /ID'),
    '#size' =&gt; 35,
    '#maxlength'=&gt; 255,
    '#attributes' =&gt; array(
         'onblur' =&gt; "if (this.value == '') {this.value = 'Enter Script name/Code /ID'}",
         'onfocus' =&gt; "if (this.value == 'Enter Script name/Code /ID') {this.value = ''}",
         ),
  );

  $form['submit'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; 'Search',
    '#states' =&gt; array(
         'visible' =&gt; array(
            'input[name="keys"]' =&gt; array('filled' =&gt; TRUE),
          ),
    ),
  );
  return $form;
}

/**
 * Create the form submit handler.
 */
function getQuotes_search_block_form_submit($form, &amp;$form_state) {
  $id = $form_state['values']['keys'];
  if ($id &amp;&amp; $id != 'Enter Script name/Code /ID') {
    drupal_set_message(t('The form has been submitted'));
    drupal_goto('custom/node/search/' . $form_state['values']['keys']);
  }
}

/**
 * Create the search results menu callback.
 */
function mymodule_menu() {
  $items['custom/node/search/%'] = array(
    'page callback' =&gt; 'mymodule_do_search',
    'page arguments' =&gt; array(3),
    'access arguments' =&gt; array('access content'),
    'type' =&gt; MENU_CALLBACK,
  );
  return $items;
}

/**
 * Create the search results callback function.
 */
function getQuotes_do_search($keys) {
  // set the page title
  drupal_set_title('FAQ search results');
  // get the search results
  $results = module_invoke('node', 'search_execute', $keys . " type:faq");
  return theme('search_results', array('results' =&gt; $results));
}


/**
 * Create the search form block.
 */
function getQuotes_block_info() {
  $blocks['faq_search'] = array(
    'info' =&gt; t('FAQ Search Block'),
    'cache' =&gt; DRUPAL_NO_CACHE,
  );
  return $blocks;
}

function getQuotes_block_view($delta = '') {
  $block = array();
  switch ($delta) {
    case 'faq_search':
      $block['title'] = 'Custom FAQ Search';
      $block['content'] = drupal_render(drupal_get_form('getQuotes_search_block_form'));
      break;
  }
  return $block;
}


How do I add the horizontal tabs?
You don't say what you want in the other tabs but if you want tabbed blocks I would recommend using the quicktabs module.

It will allow you to create a quicktabs block that contains your custom block as one tab, and any other block/view/node in other tabs.

It will be far easier than making it custom.
It is a very widely used and stable module.