TOPIC:

Javascript function to desactivate a field 2 weeks 1 day ago #249219

  • Topic Author
  • jm.phedon
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 6
  • Thanks: 0
Hello,

I'm new and i'd like to desactivate a field if the value is not something (there is arround 30 options in my list, so i'd like a way not to put all these line one by one).

The list is like this :
option1
option2
option3
option4
option5
....
other

So i'd like the desativate a field if the value is not other.

I've found the javascript code for a checkbox element, but not for list and i struggle to make it work.
Can i have some help on this subject ?
Thanks !

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

Javascript function to desactivate a field 2 weeks 1 day ago #249221

  • tihana.krivic's Avatar
  • tihana.krivic
  • Away
  • Moderator
  • Moderator
  • Posts: 1663
  • Karma: 3
  • Thanks: 149
Hi,

for this you can use visibility rules and javascript.
In your form -> Advanced-> Visiblity rules add this:
 turn on element mydummy if yourdummy is something

Then go to your select list->Advanced->Actioscript->check Custom->check Change and put this for example:
function ff_nameofselectlist_action(element, action)
{
    switch (action) {
        case 'change':
if(ff_getElementByName('nameofselectlist').value=="value2")
{
bfToggleFields('off','element','nameofyourelement',bfDeactivateField);

}
            break;
        default:;
    } // switch
} // ff_nameofselectlist_action
Please replace :
nameofselectlist with name of your select list (not title)
value2 with value of your select list (if this value is selected then turn off/on element)
nameofyourelement with name of element which you want turn on/off

Let me know if you need more help

Regards,
Tihana
The following user(s) said Thank You: jm.phedon

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

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

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

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!