Hello,

I have a coemmunity website where I have diffrent events over a few years.
I'd like to do a form where I can select a specific event.

The user would have to select the specific event in a drop down, eventually after selecting a year.
Is there any module or any way to do that ?

Thank you.
Matthieu.

Comments

Matthieu’s picture

In case someone would be interested :

. We can use a CCK node (CCK module) to add this kind of fields in a form.

. If you can't do what you want with CCK, you can use the FORM API to code yourself the form. For this kind of field, it can be done like that :

 $sql = pager_query('your query');

$content = array();
  while ($node = db_fetch_object($sql)) {
  $content[$node->nid] = $node->title;
  }
   
   $form['tournament'] = array(
  	'#type' => 'select',
  	'#title' => t('Tournament'),
  	'#options' => $content,
   ); 

Matthieu.