Is it possible to extend the visibility rules? I would need rules with more dependencies.
To implement more complex rules, it is possible to introduce rules into ActionScripts using the bfToggleFields() method.
Note: To use this method you must have previously defined at least one dummy visibility rule like:
turn on element mydummy if yourdummy is something
Example for a script into a checkbox element:
function ff_checkbox_action(element, action) //where checkbox is the name of the checkbox element { switch (action) { case 'change': if (ff_getElementByName('checkelem').checked && 1==1 ) //here you can add further dependencies 1==1 will always be true :D { return bfToggleFields('on','section','sec2',bfDeactivateField); } else { return bfToggleFields('off','section','sec2',bfDeactivateField); } break; default:; } // switch } // ff_checkbox_action
Example for radio and checkbox groups which need a special code in order to read the current value:
function ff_radioelem_action(element, action) //where radioelem is the name of the radio group { switch (action) { case 'change': vals = ''; opts = JQuery("[name=\"ff_nm_radioelem[]\"]"); for (o = 0; o < opts.length; o++) if (opts[o].checked) { vals = opts[o].value; } if (vals=="yes") // here you can add further dependencies { return bfToggleFields('on','section','sec3',bfDeactivateField); } else { return bfToggleFields('off','section','sec3',bfDeactivateField); } break; default:; } // switch } // ff_radioelem_action