I've been trying to solve this in the past few days without success, the problem I have is that I have 3 pairs of arrays, the first pair works all well but the other two pairs, come as undefined.
What I'm trying to achieve is dynamically created dropdows with the second and third dropdowns dependent of the first one, where this two are filled depending of whats selected in the first box.
If you need more code to understand the problem, just ask for it, but I think the problem must be along those lines.Code:///////////////////// // Array Variables // ///////////////////// //This ones works well var arrInput = new Array(0); var arrInputValue = new Array(0); //The 1st is only undefined, the second have values when the boxes are selected var arrInputConditions = new Array(0); var arrInputConditionsValue = new Array(0); //same as last one var arrInputValues = new Array(0); var arrInputValuesValue = new Array(0); var strStyle = "width=100%"; ///////////////////////// // Add Inputs Function // ///////////////////////// function addInput() { arrInput.push(arrInput.length); //arrInput.push(createInput(arrInput.length)); arrInputValue.push(arrInputValue.length); //arrInputValue.push(""); arrInputConditions.push(arrInputConditions.lenght); //arrInputConditions(createInputConditions(arrInputConditions.lenght)); arrInputConditionsValue.push(arrInputConditionsValue.lenght); //arrInputConditionsValue.push(""); arrInputValues.push(arrInputValues.lenght); //arrInputValues(createInputValues(arrInputValues.lenght)); arrInputValuesValue.push(arrInputValuesValue.lenght); //arrInputValuesValue.push(""); display(); displayConditions(); displayValues(); } /////////////////////// // Display Functions // /////////////////////// function display() { document.getElementById('fields').innerHTML=""; for (intI=0; intI < arrInput.length; intI++) { document.getElementById('fields').innerHTML+=createInput(arrInput[intI], arrInputValue[intI]); } } function displayConditions() { document.getElementById('conditions').innerHTML=""; for (intIC=0; intIC < arrInput.length; intIC++) { document.getElementById('conditions').innerHTML+=createInputConditions(arrInput[intIC], arrInputValue[intIC]); } } function displayValues() { document.getElementById('values').innerHTML=""; for (intIV=0; intIV < arrInput.length; intIV++) { document.getElementById('values').innerHTML+=createInputValues(arrInput[intIV], arrInputValue[intIV]); } }


Reply With Quote

Bookmarks