TOPIC:

Hiding elements via javascript 4 days 4 hours ago #261731

  • Topic Author
  • shinzan
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 75
  • Thanks: 0
Coming from the BF classic, I would hide control programatically in javsscript by referencing the element via ff_getElementByName('control') and then setting the .style.visibility = 'hidden';

That still works fine on quick mode but only the text box dissapperars obviously and i dont know of an easy way to hide the label of the text box unless i go oldschool and do a document.getElementByID("ff_element1052"); or something along those lines?

Whats the easy way to hide control and lable in an action script?

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

Hiding elements via javascript 4 days 3 hours ago #261733

  • Mirec's Avatar
  • Mirec
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 454
  • Karma: 2
  • Thanks: 19
Hi,

you can see here example, how to hide elements using JS and TURN FIELDS AND SECTIONS ON OR OFF CONDITIONALLY .

If you need more help, let me know!
Regards,
Mirko

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

Hiding elements via javascript 4 days 2 hours ago #261734

  • Topic Author
  • shinzan
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 75
  • Thanks: 0
Yeah i've seen this article but my form is more complex than this, I evaluate a javascript string look for certain values within the string and then do comparrisons and hide controls based on user selections. So I am a programmer, i want programmer syntax for javascript

Thanks,

David

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

Hiding elements via javascript 3 days 17 hours ago #261742

  • Mirec's Avatar
  • Mirec
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 454
  • Karma: 2
  • Thanks: 19
Hi,

could you export your Form, here is explained how to do it? and I will provide the correct code.

But I made one example for you, how you can do it, in the example you have two-element, and when in element 'Name' select value 'value2' element hide/show, will be hidden, otherwise will be shown.

Code you can find in Advanced of element 'Name' in section 'Action Script'. And in Advanced of Form in section 'Visibility rules'.

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

Regards,
Mirko
Attachments:

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

Last edit: Post by Mirec.

Hiding elements via javascript 3 days 16 hours ago #261743

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

just one fyi:

1) you can use javascript visibility rules for select list too
Then based on user selection elements can be hidden

2) in form->Advanced->visibility rules add this:
 turn on element mydummy if yourdummy is something
Please leave it as is (don't change anything here)

3) then go to select list->Advanced->Actionscript->check Custom->check Change and put:
function ff_nameofselectlist_action(element, action)
{
    switch (action) {
        case 'change':
if( ff_getElementByName('nameofselectlist').value== "value1" )
{
               bfToggleFields('on','element','something',bfDeactivateField); //something is name of element which you want to turn on, change it with your wantend
               bfToggleFields('on','element','something1',bfDeactivateField);
              
   }
else
 {  
bfToggleFields('off','element','something',bfDeactivateField);
 bfToggleFields('off','element','something1',bfDeactivateField);

 }
            break;
        default:;
    } // switch
} // ff_nameofselectlist_action
Please replace nameofselectlist with name of your select list (not title)
value1 is value of select list which you defined, please replace it with yours

Regards,
Tihana

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

Last edit: Post by tihana.krivic.

THiding elements via javascript 3 days 8 hours ago #261787

  • Topic Author
  • shinzan
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 75
  • Thanks: 0
Thanks this is exactly what I was looking for, I think this should go in the standard visibility tutorial too, for people who need to call these from javascript.

Thanks again!

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

Last edit: Post by shinzan.
  • Page:
  • 1
  • 2
Time to create page: 0.045 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!