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
https://forums.phpfreaks.com/topic/203196-generating-dropdown/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.