TOPIC:

Add class to element 7 months 3 weeks ago #238494

  • Topic Author
  • chrisNDP
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 1
  • Thanks: 0
How do you add a class to a form element?

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

Add class to element 7 months 3 weeks ago #238498

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 413
Hello,

Here is how you can make this work as you want.

Go to Advanced properties of your form > More options > Form pieces and in the Before Form section set Type to Custom.
In the code area below put a code like this:
echo'<style>
.mytest {
    background-color: yellow !important;
}
</style>';

echo '
<script>
    jQuery(document).ready(function(){
        jQuery("[name=\"ff_nm_fieldname[]\"]").addClass("mytest");
    });
</script>
';
NOTE: If the class that you wish to add is predefined just leave out the first part.
Also, replace "fieldname" with the actual name of the field that you wish to add the class to.

Let me know if you have managed to apply this to your form.

Regards,

Mihaela

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

  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.042 seconds

Summer Sale!

Massive discounts on all subscriptions!

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!