WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Forms
[resolved] [Plugin: WordPress Forms] How can I change the date form element? (8 posts)

  1. drougen
    Member
    Posted 3 years ago #

    Hi,

    Nice plugin :)

    How can i change the tags in the date form element?
    (day, month, year)

    Thanks,
    Drougen

    http://wordpress.org/extend/plugins/wordpress-forms/

  2. Vitor Carvalho
    Member
    Plugin Author

    Posted 3 years ago #

    During this beta release it is not possible to change it in a safe upgrade mode. You have to hardcode the plugin.
    Go to libraries/build.helper.php inside plugin's directory.

    Find function form_date and you can change the follow strings:

    $day = __('Day');
    $month = __('Month');
    $year = __('Year');

    Don't forget to save a copy of your modifications because, after every upgrade, you have to change it again. Since this is a beta release I recommend you to upgrade every time a new version is release.

    Cheers!

  3. drougen
    Member
    Posted 3 years ago #

    Ok,

    I will try that, thanks!

    Is it also possible to get rid of "share this post" ?

    /Drougen

  4. Vitor Carvalho
    Member
    Plugin Author

    Posted 3 years ago #

    "Share this post" doesn't belong to plugin. Maybe a theme feature or from another plugin.
    You can hide it with javascript. Try to do it in jQuery seeking for a form.wp_form applying next('whatever id or class share this post has')

  5. drougen
    Member
    Posted 3 years ago #

    Ok, Thanks :)

    I just have one more question,

    I don´t want a reset button for the form and I want to change name on the "submit" button. Where do I do that?

    Thanks in advance,
    /Drougen

  6. Vitor Carvalho
    Member
    Plugin Author

    Posted 3 years ago #

    Hi Drougen,

    Short answer: Within Form.php line 773 change the value of Submit.

    But, if you want something upgraded-safe you should use jQuery. Include the code above in functions.php of your theme:

    • Change Submit label: jQuery('ul.wp_forms .submit').val( 'Label you want' );
    • Hide Reset button: jQuery('ul.wp_forms .submit').next().hide();

    This should work as expected ;)

    Thank you for your support :)

  7. drougen
    Member
    Posted 3 years ago #

    Hi again,

    Thanks for your quick reply :)

    I´v tried to change the value for the submit button to:
    $html .= "<input class='submit' type='submit' value='skicka' /><input type='reset' value='Reset' />";

    But It still says "Submmit" <-- wrong spelled on the button.

    I´v also tried to use the JQuery code you posted but I didn´t get that to work. Though I´m not a very skilled programmer.

    Cheers,
    /Drougen

  8. Vitor Carvalho
    Member
    Plugin Author

    Posted 3 years ago #

    Oh, I forgot to say after the change you need to update your post!

    About the jQuery. Create a file called wp-forms.js with the code bellow in the root of your themes directory:

    //Change Submit label:
    jQuery('ul.wp_forms .submit').val( 'Label you want' );
    //Hide Reset button:
    jQuery('ul.wp_forms .submit').next().hide();

    Now, in your functions.php:

    function wp_forms_plugin_hack(){
    wp_enqueue_script( 'wp-forms-hack', get_bloginfo('stylesheet_directory') . "/wp-forms.js";
    }
    add_action( "wp_print_scripts", "wp_forms_plugin_hack"  );

    Now it should work!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic