PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Add class to submit button

  1. caroig
    Member

    I can see how I can add a class to the submit button using a filter:- http://www.gravityhelp.com/documentation/page/Gform_submit_button

    But I just want to add the class and retain the configurable/translateable string for the label. Coul you give me an example of how to do that?

    Thanks,

    Posted 11 years ago on Tuesday July 3, 2012 | Permalink
  2. David Peralty

    You could add a class to the form, and then modify the .formclass submit in your CSS. Otherwise, you would have to use the hook. To do this, click on the form title section when editing the form, and go to Advanced. From there you could set a specific form class.

    Posted 11 years ago on Tuesday July 3, 2012 | Permalink
  3. caroig
    Member

    Hi David,
    I'm happy to use the hook. My concern was the literal used in the example. I want to be able to set the button text in form settings and translate it with WPML.

    What do I need to use in the hook to make sure this happens?

    Thanks,

    Posted 11 years ago on Wednesday July 4, 2012 | Permalink
  4. David Peralty

    You might be able to maintain the translate ability of the text if you use WordPress' special echo statement for text:

    <?php _e('Submit'); ?>

    Here is an article about WordPress Translation: http://pressedwords.com/6-tips-for-localizing-your-wordpress-plugin/

    Posted 11 years ago on Wednesday July 4, 2012 | Permalink