Author Topic: programming help  (Read 1190 times)

0 Members and 1 Guest are viewing this topic.

Offline Stealth

  • Braiiins...
  • 211
Hey,

I've got a friend that needs to do this, was wondering if anyone had any ideas:

Say he's got a form.  10 fields.  The first field is a dropdown with various companies.  If the user selects company A in dropdownA, then dropdownB will display options 1, 2, and 3.  If the user selects company B in dropdownA, then dropdownB will display options 4, 5, and 6. 

How would he do that? 

 

Offline Shade

  • 211
What programming language? If c/c++, it sounds like a job for a switch/case statement, but from what you describe I imagine it's visual basic or some such, which I have no experience with.
Report FS_Open bugs with Mantis  |  Find the latest FS_Open builds Here  |  Interested in FRED? Check out the Wiki's FRED Portal | Diaspora: Website / Forums
"Oooooooooooooooooooooooooooooooooooooooh ****ing great. 2200 references to entry->index and no idea which is the one that ****ed up" - Karajorma
"We are all agreed that your theory is crazy. The question that divides us is whether it is crazy enough to have a chance of being correct." - Niels Bohr
<Cobra|> You play this mission too intelligently.

 

Offline Stealth

  • Braiiins...
  • 211
oh no it's going to have to be PHP or javascript.  some sort of web language

 

Offline Shade

  • 211
Ah, that I can do. I assume you want to avoid page loads after selection? That means javascript. I'm too lazy to explain it, so I'll just drop you a Helpful Link.
Report FS_Open bugs with Mantis  |  Find the latest FS_Open builds Here  |  Interested in FRED? Check out the Wiki's FRED Portal | Diaspora: Website / Forums
"Oooooooooooooooooooooooooooooooooooooooh ****ing great. 2200 references to entry->index and no idea which is the one that ****ed up" - Karajorma
"We are all agreed that your theory is crazy. The question that divides us is whether it is crazy enough to have a chance of being correct." - Niels Bohr
<Cobra|> You play this mission too intelligently.

 

Offline Stealth

  • Braiiins...
  • 211
great. thanks :)

 

Offline Ashrak

  • Not Banned
  • 210
    • Imagination Designs
with php you need to make only 1 dropdown when u submit then a second appears etc in steps
I hate My signature!

  
Which is why it's really a job for Javascript and AJAX. Assuming the second dropdown's contents are fixed for each selection on the first, you can load everything into the page and do it all clientside. If you don't want a page to load but the second dropdown has to be prepared serverside, you send an AJAX request and use the result to populate the second dropdown.

But that's overly complicated, and I've only been using JS for a few months, and I have an understandnig with AJAX: I don't touch it, and it doesn't chew my limbs off and beat me to death with them.
'And anyway, I agree - no sig images means more post, less pictures. It's annoying to sit through 40 different sigs telling about how cool, deadly, or assassin like a person is.' --Unknown Target

"You know what they say about the simplest solution."
"Bill Gates avoids it at every possible opportunity?"
-- Nuke and Colonol Drekker