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

6 acer ADP1 Android apache automaticmenu caching cats Centos closed source cron Debian dell Dell R200 deploy Dream driver drupal drupalcron eclair edit faceted_search fedora flat jscalendar Fosdem funambol G1 imagefield_gallery litejazz menu_tree module multiple domains mysql node_page O2Micro old openfire OSD otrs password trigger password_trigger plutado Ports presentation recover response header rpm svn sync syncml tagadelic ubuntu user filter user_import wordpress wordpress 2.3 wp2drupal xmlsitemap zabbix zimbra
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

  • Thanks for the nice blog. It
    50 weeks 7 hours ago
  • I prefer this updated
    50 weeks 4 days ago
  • Agreed.
    1 year 14 weeks ago
  • Working on this
    1 year 16 weeks ago
  • Thanx for tutorial. IT'S
    1 year 17 weeks ago
  • Amon Ra recovery tool
    1 year 20 weeks ago
  • Please help me
    1 year 25 weeks ago
  • This is so dumb
    1 year 26 weeks ago
  • I've installed it on my
    1 year 29 weeks ago
  • I am also having the same
    1 year 30 weeks 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.