javier94
Member
i have repeat a title post, because i read, and i'm trying to do, but somehting diferent.. maybe i have to change something, because this post is 2008.. not sure..
http://fabrikar.com/forums/index.ph...e-groups-based-on-a-drop-down-selection.6228/
i understand, that doing this, i will show all the elements inside of the group selected when i use the dropdown..
is that correct???
looking the older post.. i see.
"Show group" option set to "hide" - this hides the group when the form loads"
the options in Show group now are =
YES
Yes, but "hidden"
YES, but "hidden" (form only)
YES but "hidden" (details only)
only detail view
form view only
hide if not elements....
always show as lecture..
NO
So i have try.. with YES, but "hidden" ( not sure if this the appropiate )
In the older post says also
The code use in my javascript is..
//get the current value of the product drop down
var v = this.getValue();
// this is our object that maps the product drop down values (1 & 2) to the group html ids
var groups = {
1:'group20',
2:'group35',
3:'group20',
4:'group20',
5:'group20'
};
//get the html id of the group to show
var groupToShow = groups[v];
//loop over all the groups we defined in the object 'groups'
for (var i in groups ){
//if the current group is the one to show - show it
if(groups == groupToShow){
$( groups ).show();
}else{
//otherwise hide it
$( groups ).hide();
}
}
I'm trying with the 2 group.. value.. the "ID group is 35"
when i open the form.. the group is not showed.(seems is ok) . but when i move the dropdown.. and make the second selection --> nothing appears... not error or message.. should appear all elements in group with id= 35 i suppose.. or not???
Any suggestion??
Thanks in advance
Javier
http://fabrikar.com/forums/index.ph...e-groups-based-on-a-drop-down-selection.6228/
i understand, that doing this, i will show all the elements inside of the group selected when i use the dropdown..
is that correct???
looking the older post.. i see.
"Show group" option set to "hide" - this hides the group when the form loads"
the options in Show group now are =
YES
Yes, but "hidden"
YES, but "hidden" (form only)
YES but "hidden" (details only)
only detail view
form view only
hide if not elements....
always show as lecture..
NO
So i have try.. with YES, but "hidden" ( not sure if this the appropiate )
In the older post says also
- Edit the "product" element
- select the "Javascript" tab and press "Add Javascript action to element"
- Select "onchange" for the Javascript action and enter this code in the javascript code window:
The code use in my javascript is..
//get the current value of the product drop down
var v = this.getValue();
// this is our object that maps the product drop down values (1 & 2) to the group html ids
var groups = {
1:'group20',
2:'group35',
3:'group20',
4:'group20',
5:'group20'
};
//get the html id of the group to show
var groupToShow = groups[v];
//loop over all the groups we defined in the object 'groups'
for (var i in groups ){
//if the current group is the one to show - show it
if(groups == groupToShow){
$( groups ).show();
}else{
//otherwise hide it
$( groups ).hide();
}
}
I'm trying with the 2 group.. value.. the "ID group is 35"
when i open the form.. the group is not showed.(seems is ok) . but when i move the dropdown.. and make the second selection --> nothing appears... not error or message.. should appear all elements in group with id= 35 i suppose.. or not???
Any suggestion??
Thanks in advance
Javier