dynamic select elements


/ Published in: ColdFusion
Save to your folder(s)

This little block appears in most of my Application.cfm files for admins.
That allows me to easily specify which item is selected by default in a record-editing form.
For instance:


or


Copy this code and paste it in your HTML
  1. <!--- Structures for building dynamic select, radio, and checkbox inputs --->
  2. <cfset Selected=StructNew()>
  3. <cfset Selected.Yes=" Selected">
  4. <cfset Selected.No="">
  5. <cfset Checked=StructNew()>
  6. <cfset Checked.Yes=" Checked">
  7. <cfset Checked.No="">

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.