Bienvenido, Invitado
Recordarme

TEMA:

Conditional Field for checkbox group 6 meses 5 días antes #266068

  • Autor del tema
  • Cpointcc
  • Fuera de línea
  • Senior Breezer
  • Senior Breezer
  • Mensajes: 153
  • Gracias recibidas: 0
I have been watching video and reviewing this page: TURN FIELDS ON/OFF: crosstec.org/breezingformsdemo/index.php...ditional-fields.html

I am struggling to get the checkbox group options to open the textfields.

I am missing something.

I have a checkbox group with these options and they display on the form.

0;Email;Email
0;Phone;Phone

I want to show a text box for each dependent on which one is clicked on. I have the text fields

Email (email2)
Phone (phone1)

My visibility rules are:

turn on element Email if email2 is !checked
turn on element Email if email2 is !checked
turn off element Phone if phone1 is !unchecked
turn off element Phone if phone1 is !unchecked

The page is here: www.cdac.biz/contact-you .

What am I doing wrong?

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

Conditional Field for checkbox group 6 meses 3 días antes #266081

  • Avatar de Mirec
  • Mirec
  • Fuera de línea
  • Ultimate Breezer
  • Ultimate Breezer
  • Mensajes: 2498
  • Karma: 2
  • Gracias recibidas: 135
Hi,

ok, I created one example as you want!
Please download->unzip->and install it (BF->Configuration->Package Installer->select this xml file->Install Package).

You can find code in Actionscript of checkbox group element, the code is:
function ff_cb_action(element, action)
{
    switch (action) {
        case 'change':
ff_cb1_action(element, action);

ff_cb2_action(element, action);
            break;
        default:;
    } // switch
} // ff_cb_action


function ff_cb1_action(element, action)
{
    switch (action) {
        case 'change':
 vals = '';
          opts = JQuery("[name=\"ff_nm_cb[]\"]");
          for (o = 0; o < opts.length; o++)
          if (opts[o].checked)
          {
               vals = opts[o].value;
          }
          if (vals=="Email") // here you can add further dependencies
          {
               return bfToggleFields('on','element','Email',bfDeactivateField);
          }else
               return bfToggleFields('off','element','Email',bfDeactivateField);

    

            break;
        default:;
    } // switch
} // ff_cb_action




function ff_cb2_action(element, action)
{
    switch (action) {
        case 'change':
 vals = '';
          opts = JQuery("[name=\"ff_nm_cb[]\"]");
          for (o = 0; o < opts.length; o++)
          if (opts[o].checked)
          {
               vals = opts[o].value;
          }
       if (vals=="Phone") // here you can add further dependencies
          {
               return bfToggleFields('on','element','Phone',bfDeactivateField);
          }
else
               return bfToggleFields('off','element','Phone',bfDeactivateField);

    

            break;
        default:;
    } // switch
} // ff_cb_action



-function ff_cb_action(element, action) -> Instead cb insert name of your checkgroup element!

- opts = JQuery("[name=\"ff_nm_cb[]\"]"); ->Instead cb insert name of your checkgroup element!

Please create two text elements with the names "Phone" and "Email" and turn off them in advance of the element!

In the Form Advanced option scroll down to the section Visible roles and insert this code
 turn on element mydummy if yourdummy is something

If you get stuck, let me know and I will help you!
Regards,
Mirko
Adjuntos:

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

Última Edición: Post by Mirec.

Conditional Field for checkbox group 6 meses 2 días antes #266119

  • Autor del tema
  • Cpointcc
  • Fuera de línea
  • Senior Breezer
  • Senior Breezer
  • Mensajes: 153
  • Gracias recibidas: 0
Hello,

I've installed the xml file and edited the action script. I'm not sure I've done it right as it is not working.

I already had the visibility rules and the text fields created. Do I need to remove them and make what you had?

I'm confused.

Please advise.

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

Conditional Field for checkbox group 6 meses 2 días antes #266122

  • Avatar de tihana.krivic
  • tihana.krivic
  • Fuera de línea
  • Moderator
  • Moderator
  • Mensajes: 10135
  • Karma: 3
  • Gracias recibidas: 682
Hi,

please send me backend link and login information, and I will fix it directly in your form

Use this tag:
[confidential]
[/confidential]

P.S: please write name of form too

Regards,
Tihana

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

Conditional Field for checkbox group 6 meses 2 días antes #266126

  • Autor del tema
  • Cpointcc
  • Fuera de línea
  • Senior Breezer
  • Senior Breezer
  • Mensajes: 153
  • Gracias recibidas: 0
Este mensaje contiene información confidencial

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

Conditional Field for checkbox group 6 meses 2 días antes #266128

  • Avatar de tihana.krivic
  • tihana.krivic
  • Fuera de línea
  • Moderator
  • Moderator
  • Mensajes: 10135
  • Karma: 3
  • Gracias recibidas: 682
Hi,

please test it

Regards,
Tihana

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

Moderadores: ForumSupport
Tiempo de carga de la página: 0.082 segundos