Dynamic Dropdown

Do you need to create drop downs so that your users enter information correctly? Do you want to also make it so that new options can be added to the dropdown without reprogramming the page again? Then dynamic dropdown is your solution. Created by Dean Dahlvang this customization makes it possible for you to add drop downs to all sorts of areas (cities, states, countries, etc) and gives you a way to have your users manage that drop down rather than having to update the page each time an option changes. Make your life easier by using this customization!

Customization:

Contributor: 
Dean Dahlvang
Jason Treadwell

PS Verions

7.x: 
Y
Plugin: 
N
CPM Import Friendly: 
Y

Comments

Can this be done through Custom Page Management? Looks excellent but we have only do customizations through CPM. Thanks

The easiest way is to extract the files and upload the two files in \admin\districtinfo into CPM. From there you can follow the instructions in the PDF thats included in the zip.

I really like this solution and was playing around with some of the code a bit.

If anyone ever wants to use this solution and show only the codes in the drop down instead of both the code and description, you can change the code that you use to populate the drop down box.

An example of normal code is:
~[f.table_info;table=Gen;fn=sel;dothisfor=ALL;*cat=rel_types]~[custompopup;opti
on=custom;name=[01]Emerg_2_Rel;table=Gen;namefld=Name;valuefld=Name;par
entfld=ValueT;default=;sortfld=SortOrder;sortfldtype=;sortdir=1;insertblank=0]

You can change "parentfld=valuet;" to be "parentfld=;" or the following:

~[f.table_info;table=Gen;fn=sel;dothisfor=ALL;*cat=rel_types]~[custompopup;opti
on=custom;name=[01]Emerg_2_Rel;table=Gen;namefld=Name;valuefld=Name;par
entfld=;default=;sortfld=SortOrder;sortfldtype=;sortdir=1;insertblank=0]

I copied the two files to /admin/districtinfo and changed the coding in my custom web page, but I know I missed something here. Where do you put the link to access the gen_codes_edit in order to edit the drop-down menu?

And, could you provide the coding for the link?

I was able to see the page by pasting in the URL, but whatever I enter in the edit box results in an error - not saved . I am missing something ( a lot here).

Thanks for your help.

Linda Porter Kabaniec
lake_shore@yahoo.com

Is there a way to combine a text box with this field. We use this dynamic drop down for Cities. But If the City needed is not in the list, Instead of adding every little hamlet in the area to the list, Would be nice if schools could just type in themselves.

Dal9473-

How are you using this in the City field? I would love to use this in the same way, however, my understanding is there must already be a drop down field to modify.

Dena McCormick
Technology Integrator/Analyst
Milwaukee Academy of Science
dmccormick@mascience.org
414-933-0302 Ext 3302
414-933-1853 Fax

For me the sort order isn't working as expected. I have a series of dates and I specified 1, 2, 3, etc but it's doing what it wants. Also I have another one that is times and I had to put a 0 in front of 08:30 AM. Despite telling it what order I want, it is doing it in numerical order for the times. Anyone find a fix for this?

I am using Dynamic Drop down , When i apply to the page there is a blank option , how can i remove the blank from the list
below is my code:

<tr class="~[evenoddrow]">
<td class="bold">Photo/Video</td>
<td><select name="[students.students]PHOTO_VIDEO" special="lists.custom;name=PHOTO_VIDEO;table=gen;*cat=PHOTO_VIDEO;namefld=Name;valuefld=value;sortfld=name";default="1";insertblank=0>
<option></select></td>
</tr>

Subscribe to Comments for "Dynamic Dropdown"