• 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 menus

Dynamic dropdown menus 13 years 5 months ago #12026

  • ric
  • ric's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
Hi guys

Complete newbe...

Could you help me to what I'm doing wrong (can't get the second menu to work):

<script type="text/javascript">
function dynamic1(parent,child)
{
var parent_array = new Array();
// This is the default value
parent_array = ;
// All other elements
// parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;

// Get the child
var thechild = document.getElementById(child);

// Remove all other options from the select element
thechild.options.length = 0;

// What value are we looking for ?
var parent_value = parent.options[parent.selectedIndex].value;

// No value found, use the default value
if (!parent_array[parent_value]) parent_value = '';

// Set the correct length
thechild.options.length = parent_array[parent_value].length;

// Add the options
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!