Custom Submit button label (text)

Community Forums Forums Design Tips and Tricks Custom Submit button label (text)

This topic is: resolved

This topic contains 2 replies, has 2 voices, and was last updated by  csbeck 1 year, 1 month ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #46439

    csbeck
    Participant
    Post count: 135

    I wanted a special form submit button (for signing up for a newsletter) to have different text than a general Contact Us submit button elsewhere on the site. I found code to set the text differently but it was the same for every submit button. So I modified that code as follows:

    `add_filter(‘frm_submit_button’, ‘change_my_submit_button_label’, 10, 7);
    function change_my_submit_button_label($label, $form){
    if( is_home() ) {
    $label = ‘OK’;
    } else {
    $label = ‘Submit’;
    }
    return $label;
    }`

    Hopefully this will help someone else with this need.

    Chris

    #46458

    braddalton
    Participant
    Post count: 8871

    I’ll republish this if you don’t mind and link back to your site Chris. Thanks for the code.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #46474

    csbeck
    Participant
    Post count: 135

    Sounds great Brad. Thanks!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.