Form submit button

Events happening in the community are now at Drupal community events on www.drupal.org.
mayur.pimple's picture

Hi
I have use form alter function. I want add class attribute to submit button. How to apply class.

In Page there are 2 submit button. both are id is different.

Thanks
mayur

Comments

Use attributes

nagwani's picture

You can use $form['submit']['#attributes']

$form['submit']['#attributes'] = array(
'class' => 'myclass',
);

URL

nagwani's picture

http://api.drupal.org/api/drupal/developer!topics!forms_api_reference.html/7#attributes

thanks

mayur.pimple's picture

It's Works

Bangalore

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week