[development] Colored text in a form
Franz Glauber
franz.glauber at gmail.com
Thu Apr 28 16:31:35 UTC 2011
There is a proper form elemente for adding markup, which is '#type' =>
'markup' . You place HTML inside the '#value'. Nothing wrong with this
approach. #prefix and #suffix should be used to wrap elements with
additional markup or add HTML that is related to an existing element.
But that's not even the issue here, right?
On Thu, Apr 28, 2011 at 12:56 PM, James Wilson <jrguitar21 at gmail.com> wrote:
> additional HTML (that are not form elements) are typically added to the
> $form array using using #prefix and/or #suffix instead of #value.
>
> $form['#prefix'] = 'some string to appear above the form';
>
> $form['existing-element']['#prefix'] = 'this string will appear before the
> form element called existing-element';
>
> $form['existing-element']['#suffix'] = 'this string will appear after the
> form element called existing-element';
>
> James Wilson
> http://www.bluesparklabs.com
>
> On Tue, Apr 26, 2011 at 4:31 PM, Carl Jester <cjester at peladon.com> wrote:
>
>>
>> After I posted I realized I can to a _theme function to go with the _form
>> function to help lay things out nicely without having to add .tpl files or
>> other theme overhead to the project. I think it's time to go make friends
>> with drupal_render().
>>
>>
>
--
Franz
http://ciudaddelpico.com
Sent from my laptop
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20110428/4239ef6a/attachment.html
More information about the development
mailing list