This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Problem with using the FORMS API ?

Hello ,

I am putting together a contest module which allows administrators to dynamically generate contest forms .I have

I am experiencing the following problem..

1. When an administrator selects a contest from a select box it does not auto populate a select box of contestants
2. The contest selected is not shown after the form is submitted
3. Curiously it is not showing the fieldset for the page.

When you look at the $form after the form is posted you can see that the $form is constructed correctly , so it looks as though the $POST is cancelled and the page is simply loaded again.

Here is the form for the page ...

function _admin_sfx_contest_edit_form_3() {

$contests = _sfx_contests_get_contests($live='Y') ;
$default_value = ( $_POST['sfx_contest_id'] && ($_POST['sfx_activity'] == 'DEACTIVATE_CONTESTANT') ) ? $_POST['sfx_contest_id'] : 0 ;

$form['sfx-contest-edit-deactivate-contestant'] = array(
'#type' => 'fieldset',
'#title' => t('Deactivate a contestants entry'),

'#collapsible' => TRUE,
'#collapsed' => FALSE
);

$form['sfx-contest-edit-deactivate-contestant']['sfx_contest_id'] = array(
'#type' => 'select',
'#options' => $contests,
'#default_value' => $default_value ,
'#attributes' => array('onchange' => 'this.form.submit()' ),
'#DANGEROUS_SKIP_CHECK' => TRUE,

Medical Subject Headings

I am looking for other Drupal users who using Drupal in the medical / public health field and are interested to create a (taxonomy) modul for "Medical Subject Headings". I am not sure if this could be done with the taxonomy module since the "Medical Subject Headings" vocabulary is quite "big". Another aspect is the fact that the vocabulary is updated every year. Some things are added, some are thrown away. I have not seen a Drupal Module deal with that problem.

Martin

Where should static lists go?

I'm new to Drupal (though an experienced programmer) and don't yet know where things are supposed to live. I'm going to be writing a whole load of new modules, many of which require static lists of data. e.g. as values in a select list.
It's bad practice to hard code those static lists - I want to have them in a database table so that, if necessary, I can add extra values at a later date without recoding my modules, and also to disable items that I no longer want the user to see.

How do you display content from another site within a drupal cms site

Hi there. I'm new to Drupal so be nice!

I have set-up a testsite and everythings is going well. I have been asked to display a page that contains info from another website. I have spoken to the owners and they are fine with me displaying the info on my drupal site.

It's a simple html page using a table (footbal league table). All I want to do is show it on my site, but I can't seem to get anything to work.

Any suggestions?

How to get title given a path or alias?

I did search Drupal web site for this, but after a hour, unable to sort this out.

Given a Drupal path (or alias, but I can use drupal_lookup_path() to go between them), how can I get the title of that path?

For example, given node/99 or forum/47, is there a way to get the title?
Probably menu_get_item()?
menu_get_item(NULL, 'node/99') returned empty array, so not sure if there is some other issue in the way I am calling it, or if this is not the way to do it.
Any pointers appreciated.

Need to restrict the number of a node type per user

I need to be able to control the number of a particular node type one type of user can create. I've written a function that figures out the number, but I'm not sure how to go about using it. Basically, what I want to have happen is this: If a user type has a particular permission set, when he/she tries to create a new node of this type, it redirects them to another page saying "you can't, this is why". I have the new permission created and tested, as well.

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions