Jump to content

generating dropdown


aebstract

Recommended Posts

I'm not sure I 100% need ajax. I've never used ajax and have no clue where to really start. Basically, I have a dropdown that is generated based on folders in a specific directory. If I add an additional folder it'll be included in the dropdown.

 

Easy enough

<p><select name=\"category\">\n<option>Choose a Category:</option>\n";
foreach ($categories as $value) {


if ($_GET['class'] == $value) {
    $content .= "<option selected value=\"$value\">$value</option>\n";
} else {
    $content .= "<option value=\"$value\">$value</option>\n";
}



}

$content .= "</select>\n</p>

 

I want it so that when you select one of the options, it creates another dropdown right below it. There will be folders inside the folder chosen in the first dropdown, and that's what I need generated in the second one. I'm thinking this should be very easy to do, I just have absolutely no clue at all how to approach it.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.