0

Firstly, I am sorry, i just can't seem to phrase my question well.

Setup: I am using Drupal to build this location-based application.

i have a form which allows the user to select his/her location. the form has 3 'dependent' select elements e.g. country, city, state. they are dependent in such a way, that selecting a particular state [in the state select] will filter the choices which get displayed in city select, and so on.

I am trying to do this using Jquery, but i can't seem to make it work.

I know that my issue is very trivial for you out there expert in this kind of thing, but I'm not, therefore I am asking for your assistance.

Thank you very much!

ultrajohn
  • 2,527
  • 4
  • 31
  • 56
  • What have you tried so far? give more details. There are many ways of killing a dog, let's do what you have started. – Reigel Gallarde Sep 30 '10 at 05:52
  • hmmm, i am using query to change the contents of a select element, but what happened in my impl now is, the div container of my select displays everything returned from the $get call to... i'm getting a whole drupal page as output... – ultrajohn Sep 30 '10 at 05:58
  • hmm, i guess i'm not really deserving of any help from you, ;) ok thanks anyway, :) – ultrajohn Sep 30 '10 at 06:28
  • Not sure if you're aware, but it's the middle of the night in the western hemisphere here. I must have slept through my 'someone on the internet needs help with something' alarm. – anschauung Sep 30 '10 at 10:35

2 Answers2

0

Based on your comment above, I'd recommend looking into Drupal's AHAH components, which are described in detail at http://drupal.org/node/348475. The situation you're describing is precisely what AHAH was built for, and it will save you the trouble of mucking around in Javascript to manage Drupal logic.

That said, if you're not willing to go back and re-do your application using AHAH, the drupal_json() function should address the problem you described in your comment. drupal_json basically says "return a json object instead of a drupal page".

anschauung
  • 3,697
  • 3
  • 24
  • 34
0

Why use jQuery when you can use a module in Drupal that allows you build dependent select elements?

Check out http://drupal.org/project/hierarchical_select

Sid Kshatriya
  • 4,965
  • 3
  • 25
  • 29