Inserting dynamic category listings into Freeform?
Posted: 25 October 2007 01:24 AM   [ Ignore ]
Newbie
Rank
Total Posts:  3
Joined  2007-10-22

I’m currently trying to build a front-end form for an Intranet that contains a file upload field, a dropdown select list of categories, and a submit button. The idea is for employees to be able to upload a resource (such as a Word doc or a PDF file) into a particular subcategory.

The file will then be available for download in the correlating category of the intranet.

I’ve gotten the file upload function working by using Freeform, but when I try to dynamically insert category lists into a ‘select’ field, Freeform appears to strip them out. If I use a basic <form> tag, the subcategory lists work perfectly.

Here is the code I am using to pull the subcategory lists:

{exp:subcategories root_node="4"}
<option>{category_name}</option>
{/exp:subcategories}

Basically, this spits out a list of subcategories like this:

<select>
<
option>Category 1</option>
<
option>Category 2</option>
<
option>Category 3</option>
</
select>

But when I try to use Freeform to create the interface with EE, it just displays

<option>{category_name}</option>

Any suggestions/ideas would be much appreciated. Thanks so much!

Profile
 
 
Posted: 25 October 2007 06:41 AM   [ Ignore ]   [ # 1 ]
Newbie
Rank
Total Posts:  3
Joined  2007-10-22

Managed to solve this myself - had to create a template which dynamically called the subcategory lists into the dropdown. Works well now.

Profile
 
 
Posted: 25 October 2007 07:30 AM   [ Ignore ]   [ # 2 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  736
Joined  2004-03-30

Alexm,

I’m sorry that Freeform has this little inconvenience built in, but you did find the workaround. Embedding a template into Freeform gives you a lot of power.

mk

 Signature 

Mitchell Kimbrough

Profile