Bienvenido, Invitado
Recordarme

TEMA:

combine calculation and validation 4 meses 2 semanas antes #259987

  • Autor del tema
  • Neppert
  • Fuera de línea
  • Junior Breezer
  • Junior Breezer
  • Mensajes: 29
  • Gracias recibidas: 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

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

combine calculation and validation 4 meses 2 semanas antes #259988

  • Avatar de tihana.krivic
  • tihana.krivic
  • Fuera de línea
  • Moderator
  • Moderator
  • Mensajes: 7381
  • Karma: 3
  • Gracias recibidas: 529
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

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Última Edición: Post by tihana.krivic.

combine calculation and validation 4 meses 2 semanas antes #260007

  • Autor del tema
  • Neppert
  • Fuera de línea
  • Junior Breezer
  • Junior Breezer
  • Mensajes: 29
  • Gracias recibidas: 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

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

combine calculation and validation 4 meses 2 semanas antes #260021

  • Avatar de tihana.krivic
  • tihana.krivic
  • Fuera de línea
  • Moderator
  • Moderator
  • Mensajes: 7381
  • Karma: 3
  • Gracias recibidas: 529
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

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

  • Página:
  • 1
Tiempo de carga de la página: 0.048 segundos