Custom Fields
Re-Envisioned
Support MB Frontend Submission How to set a class for the button?

  • Creator
    Topic
  • #19784
    Resolved EddyPiV
    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?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #19802
    Long 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
    EddyPiV
    Participant

    Excellent! Thanks a lot.

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