Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
How to get a span tag in a form label?
I have a label tag like this:
<txp:mem_form_select_section name="article_section" label="Type <span>*</span>" ........
With the resulting output:
<label for="classified_cat" class="memSelect classified_cat">Category <span>*</span></label>
Anyone know if there is a way to get this to work? The goal is to use an asterisk for a required field and style it a little.
Offline
Re: How to get a span tag in a form label?
Uhm, you can make the askerisk as background-image for the label of the required fields.
So you can reduce some DOM-nodes and HTML-code.
Digital nomad, sailing the world on a sailboat: 32fthome.com
Offline
Re: How to get a span tag in a form label?
Hey Tommy, yes I already tried that but had to adjust all the form widths – labels/textareas etc – in order to compensate for the padding required for the background image. Was looking for a simple way to output an asterisk and then style it red or something!
Offline
Re: How to get a span tag in a form label?
Ah yes, I understand.
A shoot in the dark: I don’t know but maybe it will work wrapped with single-quotes?
<txp:mem_form_select_section name="article_section" label='Type <span>*</span>' ........
Digital nomad, sailing the world on a sailboat: 32fthome.com
Offline
Re: How to get a span tag in a form label?
Afraid it doesn’t work! Nor does label="Type '<span>*</span>'"
:(
Might have to go with the background image option..
Offline