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.

change "submit" to "something else"

  1. Folks,
    Forgive me if I have missed something REALLY obvious... but where inside the form editor can you change the text that's printed on the "submit" button to something else ("sign up now!"; "hook me up!"; etc.)?

    I've looked all around and can't find it. The button itself is not visible on the form within the editor, which seems weird. But anyway, please let me know what I've missed.

    Thanks!
    David

    Posted 11 years ago on Sunday December 2, 2012 | Permalink
  2. David Peralty

    Go to your form in the back end as though you were going to add additional fields. Click Form Settings and then go to Advanced. It will have a section for Form Button where you can change the text.

    Posted 11 years ago on Sunday December 2, 2012 | Permalink
  3. Thank you, David! I knew it was something easy I was missing... :) Cheers.

    Posted 11 years ago on Sunday December 2, 2012 | Permalink
  4. I have tried this, but the button remains unchanged and always says "Submit Message". I have only "Submit" entered in the Form Button text box. Can't figure out why this is not working. Thanks, MM

    Posted 11 years ago on Thursday March 28, 2013 | Permalink
  5. Richard Vav
    Administrator

    It sounds like the gform_submit_button function could be being used in your themes functions.php file to change the submit button, if this is the case any changes to the submit button in the form editor may not be made.

    Have a look at the function in the documentation using the link below and then have a look in your themes functions.php file and see if you can find it being used there, if you find it copy that section of code and paste it here in the forum or use Pastie or PasteBin so we can see what exactly is going on before we offer any more advice.

    http://www.gravityhelp.com/documentation/page/Gform_submit_button

    Posted 11 years ago on Thursday March 28, 2013 | Permalink
  6. Thank you for replying Richard. Here's the related code I found in my theme's functions.php:

    * Add Gravityforms button class
    */

    remove_filter( 'gform_submit_button', 'wpcasa_gform_submit_button', 10, 2 );
    add_filter( 'gform_submit_button', 'penthouse_gform_submit_button', 10, 2 );

    function penthouse_gform_submit_button( $button ) {

    To be clear - no matter what I put in the Form Button text box - the submit buttons always say: "Submit Message"

    I appreciate your help! MM

    Posted 11 years ago on Thursday March 28, 2013 | Permalink
  7. Richard Vav
    Administrator

    I think you missed a bit when copying the following section

    function penthouse_gform_submit_button( $button ) {

    there is more to this section of code which would then finish with a closing } bracket, once I have seen that missing bit I will be able to understand exactly what that function is doing to the submit button and why you can't change it.

    Posted 11 years ago on Thursday March 28, 2013 | Permalink
  8. Oh - sorry - I believe this is the whole section:

    /**
     * Add Gravityforms button class
     */
    
    remove_filter( 'gform_submit_button', 'wpcasa_gform_submit_button', 10, 2 );
    add_filter( 'gform_submit_button', 'penthouse_gform_submit_button', 10, 2 );
    
    function penthouse_gform_submit_button( $button ) {
    
    	return str_replace( 'class="', 'class="btn btn-custom ', $button );
    
    }

    Appreciate your help. MM

    Posted 11 years ago on Thursday March 28, 2013 | Permalink
  9. There may be more code in your theme's functions.php file or another included file. Can you please post all the functions.php at pastebin.com or pastie.org so we can take a look? Or, search all your theme files for the string "Submit Message" since it has to be in there somewhere (or it could be a theme option setting which would be stored in the database.) That wording is not coming from Gravity Forms. It's coming from your theme.

    Posted 11 years ago on Sunday March 31, 2013 | Permalink
  10. Man, I've done a search (with a real search) through all the theme files and can not find "Submit Message". Here's the functions.php - but you won't find it here either: http://pastie.org/7269065. Have also looked through theme options settings - nothing! Appreciate you trying to get to the bottom of this. Thanks, MM

    If needed, I'll forward you administrator info through email for you to dig into more stuff . . .

    Posted 11 years ago on Monday April 1, 2013 | Permalink
  11. Please do send a WordPress admin login to chris@rocketgenius.com and I will take a look. I'm curious now.

    To confirm: is the button text correct in the form preview, or is it correct when you use a stock WordPress theme (twenty ten or twenty eleven)?

    Posted 11 years ago on Monday April 1, 2013 | Permalink
  12. Chris - will send admin info momentarily. Interestingly, it is incorrect in the preview! Can't check using a stock theme as the theme I'm using is almost entirely widget based - so doesn't translate well to the stock templates - and can't access the page. Appreciate your help! MM

    Posted 11 years ago on Monday April 1, 2013 | Permalink
  13. Take a look at these two files:
    wp-content/themes/wpcasa/lib/functions/helpers.php line 329
    wp-content/themes/wpcasa/lib/functions/properties.php line 1781

    This is the code from helpers.php:

    [php]
    add_filter( 'gform_submit_button', 'form_submit_button', 10, 2 );
    
    function form_submit_button( $output, $form ){
    
        return '<input name="submit" type="submit" id="submit" class="gform_submit_button_' . $form["id"] . '" value="' . __( 'Submit message', 'wpcasa' ) . '">';
    }

    If you comment out that "add_filter" line, your button text will not be overridden.

    Posted 11 years ago on Tuesday April 2, 2013 | Permalink
  14. Hello Chris - I appreciate you digging into this deeper.
    So first:
    1. where is helpers.php? - I'm assuming this is accessed through the FTP? - as I don't see it anywhere in the WP editor of the child or parent theme
    2. not sure what you mean by "comment out" - need further instruction

    Thanks, MM

    Posted 11 years ago on Tuesday April 2, 2013 | Permalink
  15. Richard Vav
    Administrator

    Chris provided the file locations in his response above but you should find in the folder that contains your theme a folder named lib, inside this folder you should find another folder named functions, inside this folder you will find the files helpers.php and properties.php

    To comment out a single line of php code you can just place two forward slashes // at the beginning of the line but as you are commenting out a multiple lines you can use the css comment method of placing /* at the start of the commented section and placing */ at the end like so

    /* add_filter( 'gform_submit_button', 'form_submit_button', 10, 2 );
    
    function form_submit_button( $output, $form ){
    
        return '<input name="submit" type="submit" id="submit" class="gform_submit_button_' . $form["id"] . '" value="' . __( 'Submit message', 'wpcasa' ) . '">';
    } */
    Posted 11 years ago on Tuesday April 2, 2013 | Permalink
  16. Thanks for replying Richard. OK understand where to find the lines of code. However, it seems that Chris is instructing me to comment out SINGLE lines (assuming in both lines 329 and 1781). Are you saying the whole group of lines (1 thru6) should be commented out ? (assuming in both lines 329 and 1781). Also, once I do this correctly - will a theme update affect these changes? Really appreciate the help. Thanks, MM

    Posted 11 years ago on Tuesday April 2, 2013 | Permalink
  17. You can comment out this single line if you want:

    [php]
    add_filter( 'gform_submit_button', 'form_submit_button', 10, 2 );

    to make it look like this:

    [php]
    // add_filter( 'gform_submit_button', 'form_submit_button', 10, 2 );

    And that will stop the function from being called. The function will still be present. Richard showed you a way to comment out all 6 lines.

    A theme update will wipe out your changes. You should always use a Child Theme in that case, so your customizations are never overwritten. If you don't want to use a child theme, you will have to maintain your changes after upgrading the theme,

    You might also contact the theme author for their support, since they are providing functionality you do not want, and not making it easy to remove. Changing the submit button text is easy enough in the form builder: I'm not sure why the do it with a function in an included PHP file.

    Posted 11 years ago on Tuesday April 2, 2013 | Permalink
  18. OK - will let you know how I make out. Thanks, MM

    Posted 11 years ago on Tuesday April 2, 2013 | Permalink
  19. Hi Chris. It was easy enough (with your help) to comment out the single appropriate line in the helpers.php - and it did eliminate the problem of the incorrect naming of the button - however, it also eliminated all the styling of the button that I had in place - styling that matched all the other (theme) buttons. In looking more closely at the appropriate code in the helpers.php I noticed it said 'submit message' - which is what it was defaulting to - so I simply changed it to 'submit' which is what I want the button to say. So this fixed my immediate problem, but I do understand that there may be unwanted functionality built into the theme and I will contact the theme's support - especially since they recommend Gravity Forms. Thanks again, MM

    Posted 11 years ago on Wednesday April 3, 2013 | Permalink
  20. Hi Chris - again thank you and Richard for all your help on this. I did forward this topic to the theme author. Here is his reply:

    Hello Michael,

    Thank you very much for bringing this to our attention.

    Actually this filter is used for wpCasa Child Themes, whereas we can customize the styling through it by appending specific classes. But yes, you (and GravityForms) are probably right that we shouldn’t limit the functionality of the plugin by theme specific PHP. I’ll pass this on to our development team to see what they can come up with in the next version of wpCasa.

    Again, thank you very much

    All the best,
    Joe [wpCasa]

    Posted 11 years ago on Wednesday April 3, 2013 | Permalink
  21. Thank you for the update. It's nice to hear from a theme developer like that.

    Posted 11 years ago on Monday April 8, 2013 | Permalink

This topic has been resolved and has been closed to new replies.