TOPIC:

Help needed with Radio Group 2 weeks 4 days ago #281084

  • Topic Author
  • guitrldy
  • Offline
  • Junior Member
  • Junior Member
  • Registered
  • Posts: 78
  • Thanks: 0
Hello!  I've attached a couple of images that I hope help explain what I need.

I've created 4 separate Radio Group sections in my form.
But I want to only let a user select one item, regardless of the section.

Is there a way to do this?
Thanks!
Lisa W.
Lisa W.
Attachments:

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

Help needed with Radio Group 2 weeks 3 days ago #281098

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Administrator
  • Administrator
  • Super Users
  • Posts: 10331
  • Thanks: 827
Hi,

I created an example form attached.
Please unzip and install it in BF => Configuration => Package Installer.
After installation, please try it out in Manage Forms.

The "magic" is in the action scripts for each radio group element (form => radio group => advanced => action scripts).
What it does for each group is disabling the others if anything changes in the current one.

File Attachment:

File Name: onlyoneradio.xml.zip
File Size:9 KB


Regards,
Markus
Attachments:

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

Help needed with Radio Group 2 weeks 3 days ago #281113

  • Topic Author
  • guitrldy
  • Offline
  • Junior Member
  • Junior Member
  • Registered
  • Posts: 78
  • Thanks: 0
Nice!

Can I assume that for my fourth radio button, I can just add it to the "let names" list of your function?

Here's what I did so far for radio button 1:
radio1 = eventStuff
radio2 = filmSubject
radio3 = rescueSubject
radio4 = otherSubject
function ff_eventStuff_action(element, action)
{
    switch (action) {
        case 'change':
        
           let names = ['ff_nm_filmSubject[]', 'ff_nm_rescueSubject[], 'ff_nm_otherSubject[]''];
        
           for(let name in names){
              
              jQuery('[name="'+names[name]+'"]').each(function(){
                jQuery(this).prop('checked', false);
              });
            }
        
            break;
        default:;
    } // switch
} // ff_eventStuff_action
Lisa W.

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

Help needed with Radio Group 2 weeks 2 days ago #281128

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Administrator
  • Administrator
  • Super Users
  • Posts: 10331
  • Thanks: 827
Yes, that should work. Just make sure that for every group, you add the other ones to be turned off.

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

Help needed with Radio Group 2 weeks 2 days ago #281131

  • Topic Author
  • guitrldy
  • Offline
  • Junior Member
  • Junior Member
  • Registered
  • Posts: 78
  • Thanks: 0
Bummer, it isn't working for me.

Would you be able to take a look at my form?
I'll attach login credentials.

Thanks!!
Lisa W.


PS.  Here's the for snippets of code I produced for each radio button.  Maybe something will jump out.
function ff_eventStuff_action(element, action)
{
    switch (action) {
        case 'change':
        
           let names = ['ff_nm_filmSubject[]', 'ff_nm_rescueSubject[], 'ff_nm_otherSubject[]''];
        
           for(let name in names){
              
              jQuery('[name="'+names[name]+'"]').each(function(){
                jQuery(this).prop('checked', false);
              });
            }
        
            break;
        default:;
    } // switch
} // ff_eventStuff_action


function ff_filmSubject_action(element, action)
{
    switch (action) {
        case 'change':
        
           let names = ['ff_nm_eventStuff[]', 'ff_nm_rescueSubject[], 'ff_nm_otherSubject[]''];
        
           for(let name in names){
              
              jQuery('[name="'+names[name]+'"]').each(function(){
                jQuery(this).prop('checked', false);
              });
            }
        
            break;
        default:;
    } // switch
} // ff_filmSubject_action


function ff_rescueSubject_action(element, action)
{
    switch (action) {
        case 'change':
        
           let names = ['ff_nm_eventStuff[]', 'ff_nm_filmSubject[], 'ff_nm_otherSubject[]''];
        
           for(let name in names){
              
              jQuery('[name="'+names[name]+'"]').each(function(){
                jQuery(this).prop('checked', false);
              });
            }
        
            break;
        default:;
    } // switch
} // ff_rescueSubject_action


function ff_otherSubject_action(element, action)
{
    switch (action) {
        case 'change':
        
           let names = ['ff_nm_eventStuff[]', 'ff_nm_filmSubject[], 'ff_nm_rescueSubject[]''];
        
           for(let name in names){
              
              jQuery('[name="'+names[name]+'"]').each(function(){
                jQuery(this).prop('checked', false);
              });
            }
        
            break;
        default:;
    } // switch
} // ff_otherSubject_action
Lisa W.

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

Help needed with Radio Group 2 weeks 2 days ago #281132

  • Topic Author
  • guitrldy
  • Offline
  • Junior Member
  • Junior Member
  • Registered
  • Posts: 78
  • Thanks: 0
Woops, how do I post confidential info here?
Lisa W.

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

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

Support Discord

Join our Discord and enter the Crosstec channels for live-support, chat forums and directly interacting with the community!

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

Subscribe to news and updates!

Special Offer

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!

Live Support Chat Opened!

Join our Discord chat here and enter the Crosstec channels to receive live support and talk directly to the team!