Events Made Easy › Forums › How do I … › Apply Existing Style to Submit Button
Tagged: button, css, Form Fields, style
- This topic has 8 replies, 3 voices, and was last updated 6 years, 3 months ago by Anonymous.
-
AuthorPosts
-
Wed 3 May 2017 at 15:18 #56163AnonymousInactive
Is there a way to apply an existing style to the submit button on the registration form? I am using Divi, and I’d like the submit button to utilize the theme’s customizable buttons (I’m building out a child theme to utilize and customize across client sites, so I’d rather not have to edit the CSS each time if I can help it).
Wed 3 May 2017 at 16:19 #56164FrankyKeymasterThe button has a name eme_submit_button, that should be used to style it. You can put custom styles in the EME settings (header-setting in tab “other”), or in a custom CSS file in your child theme, see http://www.e-dynamics.be/wordpress/category/documentation/9-changing-the-layout-css/
Wed 3 May 2017 at 16:25 #56165AnonymousInactiveYes – I know how to do that. But I wanted to know if I can add the pre-existing class to the button, because I’m using a theme builder where the styles get customized through that (and it will not apply to the EME style). I don’t want to edit the style on the events button to match every time, when I’m already editing the styles through the builder (we want to limit the amount of CSS we have to edit each time we build a site – that is why we are pre-building these child themes). For the other buttons or links, I’m able to add the theme’s style to them, which then automatically applies the customizer’s style to the element.
If not, it’s understood. Just was trying to find out if I’m missing a way to do this.
Wed 3 May 2017 at 19:13 #56166FrankyKeymasterHi,
then sorry, but not possible. While I do allow everything to be styled as much as possible, I can’t foresee settings for everything to allow to apply existing styles.
But, using jquery, you could add an existing style to the submit button, an example:$("#blabla").addClass("myclass");
Wed 3 May 2017 at 19:22 #56167AnonymousInactiveYeah I saw that workaround somewhere, I might try it. No problem at all! I love how customizable this plugin is.
Mon 10 Sep 2018 at 12:50 #58383AnonymousInactiveFranky, thanks for this great cusomizable plugin.
I am also struggling with the question above and am not able to fix it according to the instructions above.Since the page is build up dynamically by the plugin, I have no idea where to put this jquery or javascript text.
How can I add a class to the RSVP Form Submit button? For example, I’ve also tried adding the following code to page.php, but didn’t do the trick.
<script type=”text/javascript”>
var eme_submit_btn = document.getElementByName(“eme_submit_button”);
eme_submit_btn.classList.add(“bct_btn”);
</script>Thanks in advance for the help.
Mon 10 Sep 2018 at 12:56 #58384AnonymousInactiveSorry, I have figuered it out. It’s because the Submit button uses Name instead of an ID, which works slightly different. This javascript code in page.php works:
<script type=”text/javascript”>
var eme_submit_btn = document.getElementsByName(“eme_submit_button”);
eme_submit_btn[0].classList.add(“bct_btn”);
</script>Mon 10 Sep 2018 at 13:31 #58385FrankyKeymasterIn jquery it is prettier 🙂
However: every frontend submit button should already have the class eme_submit_button too, so no need to add an extra class …Mon 10 Sep 2018 at 13:48 #58386AnonymousInactiveYes, thanks!
Like also sarahcamp pointed out, sometimes it’s more usefull to add existing theme classes when you are using a builder…
-
AuthorPosts
- The forum ‘How do I …’ is closed to new topics and replies.