How to set a class for the button?

Support MB Frontend Submission How to set a class for the button?Resolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #19784
    EddyPiVEddyPiV
    Participant

    When showing the input form for a CPT in the frontend, the only attribute I gave give for the button is the button text. Consequence is that the button is transparant and different from all others that follow the settings for the theme.

    How can I assign a class to the button, or is there any other way for the button to follow the theme settings?

    #19802
    Long NguyenLong Nguyen
    Moderator

    Hi,

    You can add this code to the file functions.php in the child theme folder or use Code Snippets plugin to run the code.

    add_action( 'wp_footer', function() {
        ?>
        <script type="text/javascript">
            jQuery(document).ready(function($) {
                $('.rwmb-form-submit .rwmb-button').addClass('className'); // Add your class name
            });
        </script>
        <?php
    }, 999 );

    It will help you add class to the submit button of the form. Or you can style the submit button with the CSS selector .rwmb-form-submit .rwmb-button {}.

    #19803
    EddyPiVEddyPiV
    Participant

    Excellent! Thanks a lot.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.