Separator in Select Menu

  • trinkel
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 66
  • Thank you received: 0

trinkel created the topic: Separator in Select Menu

Is there a proper (or more proper) way of adding a separator to a select menu list in BreezingForms? Right now I'm using:
0;----------;
And then validating with valueNotNone. However, the user can still select it. The validation catches it, but it would be nice to avoid the situation entirely.

Is there a way to have a none selectable separator in a select menu list?

Thanks!
#236370
  • Posts: 2348
  • Karma: 85
  • Thank you received: 315

mihaela replied the topic: Separator in Select Menu

Hello,

In my opinion, the best way to have a none selectable separator in a select menu list is to leave the "0;
;" option, but to write a piece of code that will disable that option so that it can't be selected.

Here are instructions on how to do so.

Please go to Advanced properties of the select list element. Scroll down and in Initscript section set Custom as Type. Furthermore, check the Form Entry checkbox. In the code below put the following code:
function ff_name_init(element, condition)
{
    switch (condition) {
        case 'formentry':
jQuery('[name="ff_nm_name[]"] option:eq(3) ').prop('disabled', 'disabled');
            break;
        default:;
    } // switch
} // ff_name_init
NOTE: In the code above you have to replace all 3 instances of name with the Name of your select list element.

This is an example that will disable the 4th option in the select list element. If you wish to disable let's say 7th option, you have to use
option:eq(6)

Let me know whether you have managed to apply this to your form and whether it works as you wanted.

Regards,

Mihaela
#236379
Moderators: ForumSupporttomeperica
Time to create page: 0.058 seconds

Summer Sale!

50% discount on all of our extension subscription plans & templates!

Get Your Subscription Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

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!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here