WordPress.org

Forums

Calculated Fields Form
[resolved] Add class to submit button? (6 posts)

  1. beccalm
    Member
    Posted 10 months ago #

    Hi, I'm using the professional version of the plugin, I was wondering if it's possible to add a css class to the submit button? I've looked in the file that the form settings said to check, but the only submit button I see is this one <div id="cp_subbtn_1" class="cp_subbtn">Submit</div>, when on my page the button displayed is <div class="pbSubmit">Submit</div>. I need to add a class to the latter but no idea where to find it.

    Thanks!

    https://wordpress.org/plugins/calculated-fields-form/

  2. codepeople
    Member
    Plugin Author

    Posted 10 months ago #

    Hi,

    I recommend you modify the pbSubmit class, defined in the "stylepublic.css", located in "/wp-content/plugins/calculated-fields-form/css/stylepublic.css". If you are using any of templates available for the plugin, then you should modify the class directly in the template's file (the file style.css, located in the template's folder, "/wp-content/plugins/calculated-fields-form/templates/")

    Best regards.

  3. beccalm
    Member
    Posted 10 months ago #

    Hi, thank you for the quick reply!

    I'm using a bit of Javascript to keep the total hidden until the user clicks a "calculate" button, at which time all fields with the "total" class will appear.

    I would like the "submit" button to appear at the same time as the total, so if they want to submit their total and get in touch further they can send us an email.

    I tried adding display:none to the pbSubmit class, but it remains display:none because there is no other display style to override once the button is clicked. So, I really need to add an extra class to the "submit" button, rather than editing the current one. Any way to do this?

    Thanks!

  4. beccalm
    Member
    Posted 10 months ago #

    An alternative solution for me to use would be to add a page break before the total, and require the user to click submit before seeing their total. Can I add functionality to the submit button so it will also take the user to the next page?

  5. codepeople
    Member
    Plugin Author

    Posted 10 months ago #

    Hi,

    Your first solution is fine. You can associate the style "display:none;" to the pbSubmit class, and then, from javascript, you only should call the script code:

    jQuery('.pbSubmit').show();

    Best regards.

  6. beccalm
    Member
    Posted 10 months ago #

    Ah, that did it! I just had to remove the "display:block" from .pbSubmit in the plugin's css and it worked great.

    Thank you so much!

Reply

You must log in to post.

About this Plugin

  • Calculated Fields Form
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.