• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: dynamic dropdown change based on radio button

dynamic dropdown change based on radio button 10 years 2 months ago #30462

  • sam.samiei
  • sam.samiei's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 23
  • Thank you received: 1
how to change a value of dropdown based on radio button selection?
have two radio button A and B and have a dropdown which want to show different items based on user selection of radio button.

would appreciated if anyone could help.
thanks
The administrator has disabled public write access.

dynamic dropdown change based on radio button 10 years 2 months ago #30470

  • silviup
  • silviup's Avatar
  • OFFLINE
  • Moderator
  • Posts: 309
  • Thank you received: 49
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

dynamic dropdown change based on radio button 10 years 2 months ago #30472

  • sam.samiei
  • sam.samiei's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 23
  • Thank you received: 1
hi, i have tried that and it works if i have 2 dropdown but i need to change the list based on radio group selection. here is the code i used:

radio group name:
Service

Items:
Installation
Repair

Attribute:
onchange="dynamic1(this,'TypeOfAppliance');"

Dropdown name: TypeOfAppliance

js code:

<script type="text/javascript">
function dynamic1(parent,child){
var parent_array = new Array();
parent_array = ;
parent_array = ;
parent_array = ;
var thechild = document.getElementById(child);
thechild.options.length = 0;
var parent_value = parent.options[parent.selectedIndex].value;
if (!parent_array[parent_value]) parent_value = '';
thechild.options.length = parent_array[parent_value].length;
for(var i=0;i<parent_array[parent_value].length;i++){
thechild.options.text = parent_array[parent_value];
thechild.options.value = parent_array[parent_value];} }
</script>
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!