TOPIC:

Adding CSS class to element 1 year 2 months ago #235789

  • MarioPuco's Avatar
  • MarioPuco
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 5958
  • Karma: 119
  • Thanks: 554
Dama,

If you ahve any other question, let me know.

Regards,
Mario

Please Log in or Create an account to join the conversation.

Adding CSS class to element 1 year 2 months ago #235797

  • Eddy.vh's Avatar
  • Eddy.vh
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 351
  • Karma: 3
  • Thanks: 57
Hello.

If you want to add a class to the <span> <input ...> </span> parent <div>, like this : <div class="myCustomClass">…</div>, here's an idea:

In the Advanced Form Options, Form Parts, Before Form, add the following code:
echo'
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
'
Then in the Scripts tab, initialization script, add and adapt as needed:
function ff_yourFormName_init()
{
$(document).ready(function(){
  $(':checkbox').parent('span').parent('div').addClass('myCustomClass');
});
} // ff_yourFormName_init
yourFormName must be changed by the name of your form

This solution is not the easiest I am aware of but it allows to target the element - parent - parent of the form checkboxes

Regards.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Moderators: ForumSupport
Time to create page: 0.045 seconds

July Sale!

Discounts for all of our extensions + support. Ending July 31st!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!