DenRaf's Blog

  • Contact

Contact
View Raf Nijskens's profile on LinkedIn
OpenSource
Linux
Powered by Drupal, an open source content management system
Get Firefox
Fosdem
Visit Inuits Technical home

Locations of visitors to this page

Tags in TagCloud

5 6 ADP1 Android apache automaticmenu caching cardreader cats Centos closed source cron Debian dell Dell R200 deploy Dream driver drupal drupalcron eclair Fosdem funambol mysql node_page O2Micro old openfire OpenID OSD otrs password trigger password_trigger plutado Ports presentation recover response header rpm script svn sync syncml tagadelic taxonomy terminal logging theme ubuntu update upgrade user filter user_import virt-manager wordpress wordpress 2.3 wp2drupal xmlsitemap zabbix zimbra Zimbra LDAP
more tags
Home » Blogs » DenRaf's blog

Dynamic selectbox in Drupal

Submitted by DenRaf on Tue, 05/27/2008 - 18:40
  • [View]

For a subscribing form I need a dynamic selectbox, which was reloaded when a first selectbox was changed.

I tried activeselect, which worked in my testing environment, but not on the actual site which had a hook_regions (bug: http://drupal.org/node/125451).

Hierarchical select was just not the way to go in case of this site. It required the use of vocabularies, while I was working with database content directly. And so many other solutions I tried, but without the wished result. After some searching I found this: http://f5sitedesign.com/drupalcamp.
After modifying the module, I finally had it working.

Attached you can find a simple module. As you can see in the code it requires the location module and some content in the db. I'll see if I can provide some data for in the location db.

It provides a lillte module for subscriptions. In this case it's for selecting a province which will load the second selectbox with offices in that province. It's not the best example. because for this you can use HS, but atleast you get an idea.

The module provided at the drupalcamp site shows an example with replacing text in a div and the principal for this is just the same. So you can replace anything you want as long as you have an id to hook in to.

AttachmentSize
inschrijven.tar_.gz8.63 KB
  • DenRaf's blog
  • Add new comment
Tags:
  • drupal
  • drupal

6 reponses to "Dynamic selectbox in Drupal"

1. I'd be interested also in why

Submitted by Anonymous (not verified) on Fri, 05/30/2008 - 11:31.

I'd be interested also in why Hierarchical select was just not the way to go ... HS seems like it would fit the bill perfectly.

  • reply

2. vocabularies

Submitted by DenRaf on Fri, 05/30/2008 - 23:34.

HS requires the use of vocabularies and I had dynamic db content.

  • reply

3. Why was HS "just not the way

Submitted by Anonymous on Wed, 05/28/2008 - 18:24.

Why was HS "just not the way to go"?

P.S.: this is Wim Leers, the maintainer of the Hierarchical Select module. You may want to disable the "allow anonymous comments only" option. ;) :)

  • reply

4. That's sound great! Can we

Submitted by Anonymous on Wed, 05/28/2008 - 14:52.

That's sound great!

Can we have more informations and an example?

Farf

  • reply

5. CAPTCHA

Submitted by Anonymous on Tue, 05/27/2008 - 23:05.

took me 7 tries, and then it sent it to submission

oh, and here's another captcha

  • reply

6. So...

Submitted by Anonymous on Tue, 05/27/2008 - 23:04.

are you going to share or contribute to drupal.org your modified module? ;-)

  • reply

Guided search

Click a term to initiate a search.

Categories

  • drupal (26)
  • Linux (6)
  • SysAdmin (6)
  • Uncategorized (5)
  • Linux-tools (3)

Date authored

  • 2010 (5)
  • 2009 (10)
  • 2008 (27)
  • 2007 (11)

TagCloud

  • drupal (26)
  • Ports (7)
  • cron (6)
  • drupalcron (6)
  • 6 (3)
  • OSD (3)
  • zimbra (3)
  • cats (2)
  • Fosdem (2)
  • funambol (2)
  • more...

Recent blog posts

  • OSD2010: Day 2
  • OSD2010: Day 1
  • OSD2010: Pre notes
  • Howto: Android 2.1 on G1/ADP1/Dream
  • Updated look
  • Zimbra monitoring with zabbix
  • New module: Node Page Template
  • AutomaticMenu module for drupal 6
  • Drupal synchronisation
  • Imagefield_gallery module for drupal 6
more

Recent comments

  • I've installed it on my
    1 week 5 days ago
  • I am also having the same
    3 weeks 4 days ago
  • No Video
    4 weeks 1 day ago
  • Good, just finished the
    5 weeks 2 days ago
  • Screenshot Item Trigger
    5 weeks 4 days ago
  • You don't need 2 because
    10 weeks 3 days ago
  • Oracle plugin
    10 weeks 5 days ago
  • private serverlar
    10 weeks 5 days ago
  • Thanks much for providing
    11 weeks 12 hours ago
  • Templates give you a general
    11 weeks 2 days ago

Syndicate

Syndicate content
I love Smashing Magazine!
Fervens Drupal theme by Leow Kah Thong. Designed by Design Disease and brought to you by Smashing Magazine.