http://drupal.org/node/620262

in #2 there is a solution but I couldn't figure out to impement it

is it possible for anyone to explain me how to do it and accomplish results

Comments

beautifulmind’s picture

It says
You need to implement the hook_form_alter and filtering the form using the $form_id and have to paste that code in.

Feel free to send query to beautifulmind on #drupal-support.

Regards.

Regards.
🪷 Beautifulmind

werushka’s picture

Beatufulmind thanks for your reply. My problem is I dont know how to do hook. I prefer adding template.php file would you please help me

beautifulmind’s picture

Well, you have to create a custom module( includes a .info and a .module file) to write the hook in. You can not simply add hook_form_alter in the template.php file.

Regards.

Regards.
🪷 Beautifulmind

jvizcarrondo’s picture

I'm not sure that is the best solution to the problem, but but maybe it works for you
you need to add 2 files

my_module.info

name = my_module
description = my_module.
core = 6.x
version = "6.x-1.0"
core = "6.x"
project = "my_module"
datestamp = current_date

my_module.module

function my_module_form_alter(&$form, &$form_state, $form_id) {
  //maybe you need a $form_id, this plot in all forms if exist $form['myfieldname']
  if ($form['myfieldname']) {
    $form['myfieldname']['#type'] = "select";
    $form['myfieldname']['#options'] = array(All=>"<All>",Yes=>"Yes",No=>"No");
    $form['myfieldname']['#default_value'] = No;
    $form['myfieldname']['#size'] = null;
  }
}

You can read the documentation:
hook_form_alter: http://api.drupal.org/api/function/hook_form_alter

about Computed Field module,

http://drupal.org/project/computed_field
Computing a field from a view:
http://drupal.org/node/180013
Computed Field Code Snippets
http://drupal.org/node/149228

werushka’s picture

jvizcarrondo thanks for your reply i have created the module as folliows

my_module.info

; $Id: my_module.info,v 1.1.2.3 2009/10/29 01:04:34 tdrycker Exp $
name = my_module
description = "Filter Module"
core = 6.x
package = my_module
; Information added by drupal.org packaging script on 2010-02-12
version = "6.x-1.12"
core = "6.x"
project = "my_module"
datestamp = "1266006619"

my_module.module

function my_module_form_alter(&$form, &$form_state, $form_id) {
  //maybe you need a $form_id, this plot in all forms if exist $form['field_age']
  if ($form['field_age']) {
    $form['field_age']['#type'] = "select";
    $form['field_age']['#options'] = array(All=>"<All>",Yes=>"Yes",No=>"No");
    $form['field_age']['#default_value'] = No;
    $form['field_age']['#size'] = null;
  }
}

ant I set the field_age in views filter as Exposed and "is equal to" = All

should I enable the module because if i enable the module it just gives me like debug info

jvizcarrondo’s picture

you need add php tags in my_module.module

<?php

function my_module_form_alter(&$form, &$form_state, $form_id) {
  //maybe you need a $form_id, this plot in all forms if exist $form['field_age']
  if ($form['field_age']) {
    $form['field_age']['#type'] = "select";
    $form['field_age']['#options'] = array(All=>"<All>",Yes=>"Yes",No=>"No");
    $form['field_age']['#default_value'] = No;
    $form['field_age']['#size'] = null;
  }
}

werushka’s picture

thanks for the quick tip now i can enable the module but i still see field_age field that i have to enter a value to do filter :(( something must be missing

werushka’s picture

it was my bad I was putting a wrong field name...now it works please provide me your paypal email...

jvizcarrondo’s picture

I will send my mail yesterday for your contacts form