• 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: I can't add values to my dropdown for calculation

I can't add values to my dropdown for calculation 4 years 6 months ago #40685

  • bndesign
  • bndesign's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
I need to put a value on each item to make calculations. The code just below does not take the values to make the calculation.

Can someone help me??

//FUNÇÃO INVERSOR 1
 
function dynamic2(parent,child)
{
    var parent_array = new Array();
    // This is the default value
    parent_array[''] = ['Inversor'];
    // All other elements
    // parent_array['PARENT NAME'] = ['CHILD 1','CHILD 2','CHILD 3','ETC'];
parent_array['3kw'] = ['Canadian - CSI-3KTL1P-GI-FL [p1]'];
parent_array['4kw'] = ['Canadian - CSI-4KTL1P-GI-FL [p2]'];
parent_array['5kw'] = ['Canadian - CSI-5KTL1P-GI-FL [p2]'];
parent_array['7kw'] = ['Canadian - CSI-7KTL1P-GI-FL [p3]'];
parent_array['9kw'] = ['Canadian - CSI-9KTL1P-GI-FL [p3]'];
parent_array['15kw'] = ['Canadian - CSI-15KTL-GI-LFL [p4]'];
parent_array['20kw'] = ['Canadian - CSI-20KTL-GI-LFL [p4]'];
parent_array['20kw - 380v'] = ['Canadian - CSI-20KTL-GI-FL - 380v[p8]'];
parent_array['25kw'] = ['Canadian - CSI-25KTL-GI-L[p6]'];
parent_array['25kw - 380v'] = ['Canadian - CSI-25KTL-GI-F - 380v [p8]'];
parent_array['30kw'] = ['Canadian - CSI-30KTL-GI-L [p6]'];
parent_array['30kw - 380v'] = ['Canadian - CSI-30KTL-GI-FL - 380v [p8]'];
parent_array['40kw'] = ['Canadian - CSI-40KTL-GI-FL [p8]'];
parent_array['50kw'] = ['Canadian - CSI-50KTL-GI [p12]'];
parent_array['60kw'] = ['Canadian - CSI-60KTL-GI-H [p12]'];
parent_array['125kw'] = ['Canadian - CSI-125KTL-GI-E [p20]'];
 
    // 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[i].text = parent_array[parent_value][i];
        thechild.options[i].value = parent_array[parent_value][i];
    }
}
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!