TOPIC:

combine calculation and validation 2 weeks 1 day ago #259987

  • Topic Author
  • Neppert
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 29
  • Thanks: 0
Hi,

How could I define a validation script including several elements?

My aim is to make a form where people can choose whether they want to pay just one day or two and choose the conditions. So dependent on the first choice there are added more variables.
So I set up a form calculating the sum. Every checked item is calculated. But I need a validation whether one of the single checkboxes for the days is chosen.

If I would use a Checkboxgroup or Radiogroup, then there would only the number sent, not the chosen value.
Or is it possible to grab this value for the mail to be sent?
Finally I want the people to get a message like: 'You booked day 1 for 35 $'.

Any ideas?

Thanks,
Katja

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

combine calculation and validation 2 weeks 1 day ago #259988

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 6086
  • Karma: 3
  • Thanks: 429
Hi,

basically, checkbox group is defined like:
0;Label; Value
0;Label1;Value1

If someone select Label->then Value is sent, if someone select Label1, then Value1 is sent (shown in email)

You can use this validation for checkboxgroup:
crosstec.org/en/support/online-documenta...kbox-validation.html

Hope this helps

Regards,
Tihana

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

Last edit: Post by tihana.krivic.

combine calculation and validation 2 weeks 12 hours ago #260007

  • Topic Author
  • Neppert
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 29
  • Thanks: 0
Hi,
thanks Tihana - I saw the posting how to calculate Radiovalues a while ago.

But my problem is, that I need a value to calculate, but the label should be posted as well.
This would be no problem, if I had just single Checkboxes - but I want the users to choose just one of one group. Therefore I should rather use a radiogroup.
But the label posted after sending the form is the label of the whole group and not the label of the single field.
So: is there a possibility to address the label of the selected item in a group?
Thanks,
Katja

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

combine calculation and validation 1 week 6 days ago #260021

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 6086
  • Karma: 3
  • Thanks: 429
Hi,

by default this is not possible.
But there is an alternative.

1) add textfield or hidden input element to your form
2) go to your radio group->Advanced->ActionScript->check Custom->check Change and put:
function ff_nameofradiogroup_action(element, action)
{
   switch (action)
     {
          case 'change':
          vals = '';
          opts = JQuery("[name=\"ff_nm_nameofradiogroup[]\"]");
          for (o = 0; o < opts.length; o++)
          if (opts[o].checked)
          {
               vals = opts[o].value;
          }
          if (vals=="yes") // here you can add further dependencies
          {
              ff_getElementByName('nameoftextfieldorhiddeninput').value='Yes';
          }
          else
          {
               ff_getElementByName('nameoftextfieldorhiddeninput').value='No';
          }
          break;
          default:;
     } // switch
} // ff_nameofradiogroup_action
Please replace:
-nameofradiogroup with name of your radio group (not title)
-nameoftextfieldorhiddeninput with name of your textfield or hidden input (not title)
-yes->is value of radiogroup, please replace it with yours
Yes->is label of radiogroup, please replace it with yours

After that when someone select radio group value, the title(label) of this selected value will be shown in textfield/hidden input

Let me know if you need more help

Regards,
Tihana

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

  • Page:
  • 1
Time to create page: 0.047 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!