how can I set the toggle on a form?

Ajyamal

New Member
hi,

how can I set the toggle on a form ? help me pls.

A form has a button which is created by button plugin.
I wanted to make some elements to show/hide when it was clicked.
Otherwise I do not think that the trigger must be button, it may be a text that I made.

I set the toggle on the button element at first, next on the other elements that I wanted to show/hide.
however nothing to happen.

best regard
 

Attachments

  • a_form.png
    a_form.png
    4.6 KB · Views: 225
  • setting.png
    setting.png
    11 KB · Views: 259
  • effected.png
    effected.png
    15.8 KB · Views: 215
Since you have several fields you want to hide/show, the easiest way to do this is to put all these field into a seperate group (on the same form of course), so your button will be in group1 (with other fields that have to be displayed when the form loads) and the others are in group2.

In the Javascript tab of your button element, you have to set actions for

  • "load" : hide your group2 when the form loads
    your settings should look like : action : load - hide : group2 - when this != 0
  • "click" (add a second JS action) : shows your group2 when your button is clicked
    your settings should look like : action : click - show : group2 - when this != 0
 
thank u , jfquestiaux!

I did this, but it does not work. strange...... the button plugin would need a action (onsubmit)???

I try to do this.
case1: trigger = button plugin
- (1st) action : load - hide : group2 - when this != 0 (2nd) action : click - show : group2 - when this != 0

case2: trigger = radiobutton (1: close, 2: open)
- (1st) action : load - hide : group2 - when this != 0 (2nd) action : click - hide : group2 - when this != 0
- (1st) action : select - hide : group2 - when this ==1 (2nd) action : select - show : group2 - when this == 2

case3 trigger = checkbox (1: close, 2: open)
- (1st) action : load - hide : group2 - when this != 0 (2nd) action : click - hide : group2 - when this != 0
- (1st) action : select - hide : group2 - when this ==1 (2nd) action : select - show : group2 - when this == 2

I also had looked at here http://fabrikar.com/forums/index.php?wiki/elements/, and try to do this. however....
 

Attachments

  • button_setting.png
    button_setting.png
    26.1 KB · Views: 205
Strange. Case 1 works for me (see screenshot). You are sure that your group2 is in the same form as your "main" group?

case2 you should use a yes/no element
- (1st) action : load - hide : group2 - when this != 1
- (2nd) action : click - hide : group2 - when this != 1
- (3rd) action : click - show : group2 - when this ==1
 

Attachments

  • screenshot.png
    screenshot.png
    42.4 KB · Views: 186
oh, do I have to wrap the elements (which should be effected by the show/hide function) into a group (new group) ??I thought if it is true, how to wrap elements into the new group...
I think that I would not understand what you tell me...
 
Yes : leave the button (+ any other element you want to be shown when the form loads) in the group that was created when you created the list.
Then in the "groups" tab, create a new group (group2) that you set to be included in your existing form.
Then, if the elements you want to hide exist already, move them into group2 (you open the elmeent, change the group setting and save). If they don't exist, create them into group2.
Then put the JS for the button to hide/show group2.
 
hmm. i am going to go on trying for a while.

trigger = button (setting2.png )
trigger = yes/no (setting3.png) -> resault (loaded_form_view.png)

does not work...
 

Attachments

  • setting2.png
    setting2.png
    26.6 KB · Views: 192
  • setting3.png
    setting3.png
    23.5 KB · Views: 195
  • loaded_form_view.png
    loaded_form_view.png
    47.4 KB · Views: 201
hi,

I renew my site, this is working ! it would be conflicting a other J plugin. however it was only hide/show :) how to do show->hide.
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top