CluesShop.com

Thursday, 30 October 2014

Active search get rebuild the form using drupal 7 seach


function specialoffers_manage_validate($form, &$form_state) {
 drupal_set_title('Special  Offers');
   
   drupal_add_css(drupal_get_path('module', 'specialoffers') .'/css/specialoffers.css');
 
   $acitiveinactive = '';
   

    $form['#method'] = 'post';
       
      $acitiveinactive = isset($_POST['filterset']['filteroptions']) ? $_POST['filterset']['filteroptions'] : 1;
 
   
       if(($acitiveinactive == '1') || ($acitiveinactive == '0') ){
               $offerstatusresult =  new  offersoverview();
               $offerstatusresult->status = $acitiveinactive;
             
               $result =   $offerstatusresult->getoffersOrderbyPosition();
       } else{
              $offersall =  new  offersoverview();
              $offersall->status = $acitiveinactive;
              $result =   $offersall->getoffersAll();
       }
   
   global $base_url;
   $form['filterset'] = array(
          '#type' => 'fieldset',
         '#prefix' => '<div class="fleetviewcontain">',
       
       );
     $form['filterset']['filteroptions'] = array(
'#id' => 'filteroptions',
'#type' => 'select',
'#options' => array( 'All' => 'All' ,'1'=>'Active','0'=>'Inactive'),
"#limit_validation_errors" => array(),
'#default_value' => $acitiveinactive,
);

$form['filterset']['btn'] = array(
'#type' => 'submit',
'#value' => 'Go',
                     

);






function specialoffers_manage_validate($form, &$form_state) {

 
if ($form_state['triggering_element']['#value'] == 'Go') {
$form_state['rebuild'] = TRUE;
return;
}

}

No comments:

Post a Comment