Tech Journal
Latest Entries
- Custom code based on image sizes in ExpressionEngine
- Mining date-based ExpressionEngine URLs
- Preselecting Pulldowns in ExpressionEngine Standalone Edit Forms
Tech and Design
- My Favorite New Things From 2009
- Five Things I’ve learned About Freelancing
- Interesting Data Visualization
- Hydrogen Car Design to be Released “Open Source”
- Chicago Design Archive
- Keynote ‘09 - “View Package Contents”
iPhone
- iPad is more than just an e-Reader
- iPhone App Showcases Hi-Def Holographic Recordings
- iPhone as Digital Swiss Army Knife
Web
- Skipping the Multi-entry Page in ExpressionEngine
- Opera Unite
- Assigning movie clips levels in Actionscript 3.0
- Opening Shadowbox windows from a link in Flash
- Passing FLV file paths to an AS 3.0 SWF with SWFobject
Motion
Preselecting Pulldowns in ExpressionEngine Standalone Edit Forms
June 02, 2010
This is for EE 2.0, and if you are using an earlier version, skip the system hack.
To create a Stand-Alone-Edit form, first follow the method graciously shared by Ty Wangsness, of eMarketSouth:
http://www.emarketsouth.com/blog/details/how-to-create-standalone-edit-forms-in-expressionengine-2.0/
Beware that you need to perform a small hack to your EE system. When I do this, I keep a text file with my site files in which I record any hacks or alterations I've made so I have a list of things to be aware of when upgrading the system.
Pre-selecting pull-downs
Imagine that you have a list of options in a custom field pulldown menu, as follows;
<select id="field_id_01" name="field_id_01">
<option value="option1">option1</option>
<option value="option2">option2</option>
<option value="option3">option3</option>
<option value="option4">option4</option>
</select>
Just use a conditional to compare your pulldown options with the information stored for that entry in the database, in conjunction with the HTML "selected" feature;
<select id="field_id_01" name="field_id_01">
<option value="option1" {if channel_fieldName == "option1"}selected="selected"{/if}>option1</option>
<option value="option2" {if channel_fieldName == "option2"}selected="selected"{/if}>option2</option>
<option value="option3" {if channel_fieldName == "option3"}selected="selected"{/if}>option3</option>
<option value="option4" {if channel_fieldName == "option4"}selected="selected"{/if}>option4</option>
</select>
Now your pulldown form fields should be preselected with the current value from the database.

Leave a Comment