0

In my CFWheels settings.cfm, I have the following code:

set(functionName="selecttag",       labelPlacement="before", prependToLabel="<div class='field field-select'>",     append="</div>", appendToLabel="", class="field-select");
set(functionName="select",          labelPlacement="before", prependToLabel="<div class='field field-select'>",     append="</div>", appendToLabel="", class="field-select");

In my form view I have the following code:

<cfoutput>#selectTag(name="pin[typeid]", options=types, objectName="pin", property="typeid")#</cfoutput>

However, in the generated output, the HTML within the prependToLabel attribute is not outputted. The append attribute is working though; which of course breaks the formatting / layout of the page.

Output HTML

<select class="field-select" id="pin-typeid" name="pin[typeid]"><option value="1">Wanted</option><option value="2">Available</option></select></div>

Is this a bug, or am I doing something incorrectly here?

Thanks, Michael.

Michael Giovanni Pumo
  • 14,338
  • 18
  • 91
  • 140

1 Answers1

2

ANSWER!

In my view, I needed to add the label attribute, which I had forgotten to do.

label=""

So, my view code should have actually been:

<cfoutput>#selectTag( label="Type of Pin", name="pin[typeid]", options=types, objectName="pin", property="typeid" )#</cfoutput>

The generated HTML now works / outputs as expected.

Michael Giovanni Pumo
  • 14,338
  • 18
  • 91
  • 140