- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2016 12:27 AM
Hi Community..i need to populate the drop down list based on the another dropdown value.Please help me out.
example: there is drop down called state, if user will select the state(eg:karnataka), then in below drop down i need to display all the district of that state.Please help me in this.Thanjks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2016 05:43 AM
Hi All
I have done using client script
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var u_ent = g_form.getValue('u_entity');
alert(u_ent);
if(newValue == 'Austria'){
var dVals = '20,21,22,24,60,70,90';
var dOpts = dVals.split(',');
var myIndex = 1;
//housekeeping, clear values in case this is used onchange
g_form.clearValue('u_tax_code_sub');
g_form.clearOptions('u_tax_code_sub');
//Add the standard none option
g_form.addOption('u_tax_code_sub', '-- None --', '-- None --', 1);
for (i = 0; i < dOpts.length; i++) {
myIndex++;
g_form.addOption('u_tax_code_sub', dOpts[i], dOpts[i], myIndex);
}
}
if(newValue == 'Belgium Sales Company'||newValue == 'Belgium Plant'){
var u_code = 'V0,V1,V2,V3,V4,V5,V6,VA,VB,VC,VD,VE,VF';
var u_split = u_code.split(',');
var myIndex1 = 1;
//housekeeping, clear values in case this is used onchange
g_form.clearValue('u_tax_code_sub');
g_form.clearOptions('u_tax_code_sub');
//Add the standard none option
g_form.addOption('u_tax_code_sub', '-- None --', '-- None --', 1);
for (i = 0; i < u_split.length; i++) {
myIndex1++;
g_form.addOption('u_tax_code_sub', u_split[i], u_split[i], myIndex1);
}
}
if(newValue == 'Sweden Sales Company'){
var u_code1 = '21,22,23,60,70,80,90';
var u_split1 = u_code1.split(',');
var myIndex2 = 1;
//housekeeping, clear values in case this is used onchange
g_form.clearValue('u_tax_code_sub');
g_form.clearOptions('u_tax_code_sub');
//Add the standard none option
g_form.addOption('u_tax_code_sub', '-- None --', '-- None --', 1);
for (i = 0; i < u_split1.length; i++) {
myIndex1++;
g_form.addOption('u_tax_code_sub', u_split1[i], u_split1[i], myIndex2);
}
}
if(newValue == 'Spain'){
var u_code2 = 'R0,R7';
var u_split2 = u_code1.split(',');
var myIndex3 = 1;
//housekeeping, clear values in case this is used onchange
g_form.clearValue('u_tax_code_sub');
g_form.clearOptions('u_tax_code_sub');
//Add the standard none option
g_form.addOption('u_tax_code_sub', '-- None --', '-- None --', 1);
for (i = 0; i < u_split2.length; i++) {
myIndex1++;
g_form.addOption('u_tax_code_sub', u_split2[i], u_split2[i], myIndex3);
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2016 12:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2016 02:37 AM
Hi
Thanks for the response. But for each selection dependent drop-down value will change.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2016 02:52 AM
Do you mean that in the 2nd field same choice may be there for different 1st field choice?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2016 02:56 AM
yes..best on the 1st choice selection need to popup set of value for 2nd choice.