• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

select based on select

New Here ,
Jun 28, 2006 Jun 28, 2006

Copy link to clipboard

Copied

I have two selects on a form. The first select is populated with directories in the root. The directories in the root may have subdirectories. If a directory with subdirectories is chosen in the first select, I want the second select to be populated with the subdirectories. The selects will be used to allow users to choose a directory and one subdirectory in which to upload a file. Here's what I have so far:

<form action="uploadSection.cfm" method="post" name="upload" enctype="multipart/form-data" class="body">
<p>Choose folder to put file in:<br />
<select name="mnuFolder" onchange="populateSubFolder()">
<cfdirectory action="list" directory="D:\theroot\" name="Parent_Folder">
<cfloop query="Parent_Folder">
<cfif #Parent_Folder.Type# eq "Dir">
<cfoutput>
<option value="#Parent_Folder.Name#\">#Parent_Folder.Name#</option>
</cfoutput>
</cfif>
</cfloop>
</select>
<br />

Choose subfolder (if any):<br />
<cfdirectory directory="theroot\#Parent_Folder.Name#\" name="Sub_Folder">
<select name="mnuSubFolder">
<cfoutput query="Sub_Folder" group="name">
<cfif #Sub_Folder.type# IS "DIR">
<option value="#Sub_Folder.Name#\">#Sub_Folder.Name#</option>
</cfif>
</cfoutput>
</select>


The first select is populated as expected but the second remains empty even if you choose a directory in the first.

Any ideas are greatly appreciated.

Doug Wilder
Fairbanks, AK
TOPICS
Advanced techniques

Views

246

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 28, 2006 Jun 28, 2006

Copy link to clipboard

Copied

LATEST
idea number 1 - google coldfusion related selects
idea number 2 - try to find the custom tag a lot of people use. I forget the name.
idea number 3 - find the code I once posted on one of these forums. It will contain the word etiology.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation