3

Is there an easy-ish way to modify the webform-form-tpl.php template to show disclaimer text above the submit button in a Drupal webform? I can add text below the button, but do not know how to split up the button from the other elements to add text between them, ie:

[form-elements]
[disclaimer text]
[submit button]

Cheers!

googletorp
  • 33,075
  • 15
  • 67
  • 82
james6848
  • 1,657
  • 3
  • 25
  • 39

3 Answers3

4

The easiest option is probably is insert the text as a markup form item using hook_form_alter on the form.

googletorp
  • 33,075
  • 15
  • 67
  • 82
  • That way, you could even create a checkbox which sumbittants have to check (sth. like "I've read T&C."). – Paul Apr 15 '10 at 10:43
  • The text could be added to the submit button's '#prefix' property. If you add a checkbox instead, make it required, so people can't submit the form if the box isn't checked. – Graham Apr 15 '10 at 14:27
3

This worked for me :

$form['actions']['submit']['#prefix'] = 'Disclaimer...';
weeger
  • 429
  • 2
  • 9
0

This doesn't really belong in the theme layer; it's content. You can add the disclaimer as a markup component to the end of the webform and it should appear after the other webform components and before the submit button like you want.

Scott Reynen
  • 3,530
  • 18
  • 17