Hi

I have created a submit form

$form['submit'] = array(
 '#type' => 'submit',
 '#value' => 'A submit button, you are about to submit this form',
);

which produces a submit button with 'A submit button, you are about to submit this form' text over the top - as it should.

However I would like to be able to theme the text.

I tried 
<code>
<h2>A submit button,</h2> <p>you are about to submit this form</P>

but the tags get displayed instead of getting rendered.

I know that there are some elements which can render html such as

 $form['submit']['text'] array(
 '#markup' => '<h2>A submit button,</h2> <p>you are about to submit this form</P>',
 );

but markup does not work on button element types.

I have tried creating the markup as a variable but this just creates a wsod or creates the button without any text.

I tried creating the button as a parent and the mark up text as a child but that doesnt work either.

Im really stuck on how to style the submit text on submit buttons

Any help is appreciated.

Comments

Jeff Burnz’s picture

Input elements use attributes, such as value="button text", you can't put tags inside HTML attributes.

There are ways around this, but its quite hard, you might be better of using an image button and sticking the text in the image.