Form Help

TOPIC:

Validation between 2 radio fields 8 months 2 days ago #272249

  • Topic Author
  • mcambou1
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 23
  • Thanks: 0
Hi,

I have a form with 2 list of radio button like this

FIELD A:
option 1
option2
option 3

FIELD B
option 1
option 2
option 3

I want check if at least one of this 6 radio is checked, how can i do that?

Thanks
Best regards

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

Validation between 2 radio fields 8 months 2 days ago #272251

  • Mirec's Avatar
  • Mirec
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 3262
  • Karma: 2
  • Thanks: 160
Hi,

oke, I will create one example for you!

give me a little time and I will back to you as soon as possible

if you have more questions, feel free to ask!

Regards,
Mirko

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

Validation between 2 radio fields 8 months 2 days ago #272252

  • Mirec's Avatar
  • Mirec
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 3262
  • Karma: 2
  • Thanks: 160
Hi,


oke, I create one example for you with two elements type 'radio groups and one text element where we can see is one of those two radio groups checked! This text element you can hide (hidden in the front of the site that users can't see).

Please download->unzip->and install it (BF->Configuration->Package Installer->select this xml file->Install Package).


you can find the code in Advanced of FORM -> More Options -> scripts -> Ini Script, and the code is:
function ff_QuickForm1660675129_init()
{
setInterval('test()',500);
} // ff_QuickForm1660675129_init


function test(){
 opts = JQuery("[name=\"ff_nm_a[]\"]");
          for (o = 0; o < opts.length; o++)
          if (opts[o].checked)
          {
              ff_getElementByName('c').value='Checked!';
          }
 opts1 = JQuery("[name=\"ff_nm_b[]\"]");
          for (o = 0; o < opts1.length; o++)
          if (opts1[o].checked)
          {
              ff_getElementByName('c').value='Checked!';
          }


}

a- name of 1st RG
b-bane of 2st RG
c-name of the element where is shown is element checked!

If you need additional explanation connected with the code, please let me know!

Regards,
Mirko
Attachments:

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

Validation between 2 radio fields 8 months 2 days ago #272254

  • Topic Author
  • mcambou1
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 23
  • Thanks: 0
Thanks a lot,

just a little question, why it's need the function with the interval at first? is it not possible to check fields when the user click on submit?

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

Validation between 2 radio fields 8 months 2 days ago #272255

  • Mirec's Avatar
  • Mirec
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 3262
  • Karma: 2
  • Thanks: 160
Hi,

yes of course we can do it over section validation in the Properties of element!

Navigate to your element->Properties scroll down to the section 'Validation', select type 'Library', and find script ff_anychecked!

In sections 'error message' you can insert your error message!

It is all!

The difference between the two solutions that I sent is, in the first solution, the User can send a FORM and you can see is he checked the radio G. in the other solution user doesn't can send a FORM if he isn't checked element!

If you have more questions, feel free to ask!

Regards,
Mirko

Attachments:

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

Last edit: Post by Mirec.
  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.054 seconds

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

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!