[html-formfu] How to remove the <span>..</span> for customized element

Carl Franks fireartist at gmail.com
Mon Aug 20 22:41:05 GMT 2007


On 20/08/07, kewei xiao <kewei.xiao at nald.ca> wrote:
> Hi Carl
>
>     when I create my customized select elements, there is <span> class
> created as well.  I wonder if there is way to remove it.
>
>     something like this:
>
>     <div id="Category" class="Category">
>    <span class="formelementcategory label">
>    <label for="firstBox">Category:</label>
>    <select id="firstBox" onchange="getSecond(this.id)" name="firstBox">
>    </select>
>    </span>

I take it your example is the current output, not the output you'd like?

To get rid of the span in the example, my first thought was to
recommend you copy the field template, customize it, and set your
element to use the customised one...
...but then on second thought, I decided it was a quite reasonable
request to support without having to customise your templates.

So now if you do $field->container_tag(undef);
- or "container_tag: ~" in yaml -
it'll skip the span tag.

If you're not wanting to update to the latest trunk after the many
recent changes, simply look at the changes made to file "root/field"
for r308.

Carl



More information about the HTML-FormFu mailing list