Hi I am looking for a way to position the submit button uniquely for two different webforms.

Thank you for your time and effort in advance great module.

Comments

quicksketch’s picture

You can reposition the submit button wherever you like by theming the form. See the THEMING.txt file included with the module.

Road Kill’s picture

Hi Quicksketch what I am asking is how to wrap a div on the submit button so that I can uniquely position the submit button on multiple webforms.

I have created a webform tpl and tried the following code with test as my div however this is not working just wanted to know if i am using the correct code to do this or if this is even the correct approach. I have searched high and low but have found very little on this or very vague suggestions, but I can not believe that this should be such a mountain of a task to achieve.


function zeropoint_form_alter(&$form, &$form_state, $form_id) {
  if (!empty($form['actions']) && $form['actions']['submit']) {
    $form['actions']['submit']['#test'] = array('class' => array('first', 'button', 'radius'));
  }
}

Thank you for your time and effort.

quicksketch’s picture

Status: Active » Fixed

Your code looks fine but there's no FormAPI property called "#test". You probably just need to change this to #attributes. See the Form API reference and check out the section on #attributes, which is probably what you want.

function zeropoint_form_alter(&$form, &$form_state, $form_id) {
  if (!empty($form['actions']) && $form['actions']['submit']) {
    $form['actions']['submit']['#attributes'] = array('class' => array('first', 'button', 'radius'));
  }
}

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.